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...

Assuming HTML like this:

  • 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...

Hot in Week

Popular

Archive

item