Invert order of HTML elements

Posted by meo on Stack Overflow See other posts from Stack Overflow or by meo
Published on 2010-04-21T14:56:13Z Indexed on 2010/04/21 15:03 UTC
Read the original article Hit count: 357

Filed under:

I have the following configuration:

<div><div id='box1'>&nbsp;</div><div id='box2'>&nbsp;</div><div id='box3'>&nbsp;</div><div id='box4'>&nbsp;</div></div>

what i need to do is to invert the order of the divs

<div><div id='box4'>&nbsp;</div><div id='box3'>&nbsp;</div><div id='box2'>&nbsp;</div><div id='box1'>&nbsp;</div></div>

is there a fast way to do this with jQuery without cloning, removing and replacing the items?

© Stack Overflow or respective owner

Related posts about jQuery