I was given some html page. My task is to modify the ordering of the content without modifying the html, by using their class identifiers.
This is the html that is given below:
<div class="list">
<div class="txt">
<div class="header">main header for list</div>
<div class="txt">
<div class="header">header1</div>
<img class="img" src=""/>
<div class="txt" > 1</div>
<div class="txt" > 2</div>
<div class="txt" > 3</div>
</div>
<div class="txt">
<div class="header">header2</div>
<img class="img" src=""/>
<div class="txt" > 4</div>
<div class="txt" > 5</div>
<div class="txt" > 6</div>
</div>
</div>
</div>
I can use javascript,jquery and if possible css.
The goal is to change the order to make it look like this below.:
main header for list
1
header1
2
3
4
header2
5
6
Edit: It was brought to my attention that I have to include initial effort. (My apologies first post..) Here is what initially did: https://jsfiddle.net/Lwk2hor7/