skip to Main Content

Jquery – script "insertbefore" not working correctly

I have an HTML structure like this: <div class="main"> <div class="sub-main1">Content</div> <div class="sub-main2">Content</div> </div> <div class="main"> <div class="sub-main1">Content</div> <div class="sub-main2">Content</div> </div> Now, I want to move sub-main2 above sub-main1. And I have used this script: jQuery( ".sub-main2" ).insertBefore( jQuery( ".sub-main1"…

VIEW QUESTION
Back To Top
Search