reorder list elements - jQuery?

Posted by Alex on Stack Overflow See other posts from Stack Overflow or by Alex
Published on 2010-06-16T05:03:03Z Indexed on 2010/06/16 5:12 UTC
Read the original article Hit count: 159

Filed under:
|

Hello,

I am experimenting with jQuery lately, and I was wondering if it's possible with js or pure jquery to reorder <li> elements. So if I have a silly list like the following:

<ul>
    <li>Foo</li>
    <li>Bar</li>
    <li>Cheese</li>
</ul>

How would I move the list elements around? Like put the list element with Cheese before the list element with Foo or move Foo to after Bar.

So is it possible?

If so, how?

Thanks!!

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery