jquery, move an inner element to the first position?

You can use .prependTo() immediately after the re-order, like this:

$("#topNumber").prependTo("#ImportantNumbers");

You can see it working here, all it’s doing is taking the element and inserting it as the first child on the <ul>, effectively moving it to the top.

Alternatively when you sort, use :not() to exclude it depending on how the sorting works, for example:

$("#ImportantNumbers li:not(#topNumber)").randomize();

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)