I think I'm half way there. I need to change this HTML with jQuery:
Code:
<div class="main-class">
<div class="div1">
content 1
</div>
<div class="div2">
content 2
</div>
</div>
$("div.main-class").each(function() {
var holder = $(this);
$("> div", holder).each(function(){
//here I need to get entire div, including its contents, and place it before the main-class (and remove the old HTML)
//holder.before() ???
}
Which should leave this:
Code:
<div class="div1">
content 1
</div>
<div class="div2">
content 2
</div>
<div class="main-class">
</div>