I think the title makes sense:
I want to change this:
Code:
<div class="class1 x">
CONTENT A
</div>
<div class="class2 x">
CONTENT B
</div>
<div class="class3 x">
CONTENT C
</div>
<div class="class4">
CONTENT D
</div>
<div class="class5">
CONTENT E
</div>
...to:
Code:
<div class="class3 x">
<div class="changed">
CONTENT A
</div>
<div class="changed">
CONTENT B
</div>
<div class="changed">
CONTENT C
</div>
</div>
<div class="class4">
CONTENT D
</div>
<div class="class5">
CONTENT E
</div>
So basically the 'x' groups all the content together and merges with the last class holding the 'x'.
I want to loop through all divs just incase the 'x' classes are not together.
I always struggle with manipulating HTML with jQuery.