I have the following html
<img src="a.jpg" /><p> This is some random text and just to test this example. This is some random text and just to test this example. This is some random text and just to test this example<p>
<br><p>This is some random text and just to test this example This is some random text and just to test this example</p>
<img src="a.jpg" />
<br><p>This is some random text and just to test this example This is some random text and just to test this example</p>
My question is that if i have to give a preview of the text only using jquery suppose i have this in a variable named html how to display only few parts of the text ignoring the images
<div id="preview"></div>
$("#preview").val("//display only text in the variable named html")
You could filter images from the html: