Move list item to top of unordered list using jQuery

Found this even neater:

$('li').on('click', function() {
    $(this).parent().prepend(this);
});​

Live example

Leave a Comment