Tutorial Move Clicked List Items To Top Of List
Assuming HTML like this: one two three So if "Two" is clicked, move it to the top of the list. $("li").click(funct...
https://iskablogs.blogspot.com/2014/03/tutorial-move-clicked-list-items-to-top.html
Assuming HTML like this:
So if "Two" is clicked, move it to the top of the list.
$("li").click(function() {
$(this).parent().prepend($(this));
});
Will work for multiple lists...
- one
- two
- three
So if "Two" is clicked, move it to the top of the list.
$("li").click(function() {
$(this).parent().prepend($(this));
});
Will work for multiple lists...