I am trying to move content to be after test2 but at the moment it's not working.
<div id="test">
<div id="test2"></div>
</div>
<div id="content"></div>
I'm using the following jQuery:
$("#test2").after("#content");
This is how .after()
is meant to function? I've checked the jQuery docs and can't find what I'm doing wrong?
$("#content").insertAfter("#test2");
will result in:
<div id="test">
<div id="test2">b</div>
<div id="content">a</div>
</div>
jsFiddle example.
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