<div class="editor">
<p>
<img style="float:left">
</p><p>
<span>
<font>
1
</font>
</span>
</p>
<p></p>
<p>
</p><p>
<img style="float:left">
<span>
<font>
Text 3
</font>
</span>
</p>
<p></p>
the <ul>
the <li>
<span>
<font>
<p>Text 3</p>
</font>
</span>
</li>
the <li>
<font>
<p>Text 4</p>
</font>
</li>
</ul>
</div>
<div class="editor">
<p>
<img style="float:left">
1
</p>
<p></p>
<p>
</p><p>
<img style="float:left">
Text 2
</p>
<p></p>
the <ul>
the <li>
Text 3
</li>
the <li>
Text 4
</li>
</ul>
</div>
$('.editor > p')
$('.editor > ul > li')
$('.editor > h[1-6]')
var html = $('.editor').html();
html.replace(/regular expression for unwanted tags/, ");
$('.editor').html(html);
$('.editor > *').each( function(){
var images = $(this).find('img').detach();
var text = $(this).text();
$(this).html( text ).prepend( images );
});
Find more questions by tags jQuery