extracting text from html file
<p>I'm trying to get nodes containing text from html file using Javascript and jQuery.
if I have a node like 
`</p>

<pre><code>&lt;div&gt;txt0
&lt;span&gt;txt1&lt;/span&gt;
txt2
&lt;/div&gt;
</code></pre>

<p><code>
How can I select elements that meets this criteria??
Meaning, I need to retrieve the</code>div<code>and the</code>span` , and it would be even better to know location of the text.</p>

<p>I'm trying to get the text to replace it with images in a later function.
I tried this </p>

<p>`</p>

<pre><code>$('*').each(function(indx, elm){
   var txt = $(elm).text();
   // my code to replace text with images here
});
</code></pre>

<p>`</p>

<p>but it does not get the required results.. it does all the parsing in the first element, and changes the html totally.</p>
