I have a HTML code as below:
<div id="wrap">
<div id="one"></div>
<div id="two"></div>
<div id="three"></div>
<div id="foo"></div>
<div id="bar"></div>
<div id="four"></div>
<div id="five"></div>
<div id="six"></div>
<div id="seven"></div>
</div>
I want to move <div id="foo"></div>
and <div id="bar"></div>
to the bottom under <div id="seven"></div>
. Should I use insertAfter()
or after()
or any jQuery function is better to achieve this requirement?
Thanks
appendTo will move the elements to the end of the element's DOM
$('#foo, #bar').appendTo('#wrap');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With