Get only elements with text inside
Hi,
I want to get all the elements (span, paragraphs, div, etc.) that hold text inside, but just text.
e.g.: If I had :
<p>this is a paragraph</p>
<p><div>this is a paragraph with a div inside</div></p>
<div>this is a div</div>
<span>this is a span <span>with a span</span>inside</span>
So I would get just:
<p>this is a paragraph</p>
<div>this is a div</div>
Only the element with no html tags inside.
Thanks,
Regards
32 Minutes
Discussion Span
softDeveloper
Junior Poster in Training
76 posts since Nov 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
If you are comfortable with jQuery, then jquery filter() can be implemented easily.
ko ko
Practically a Master Poster
673 posts since Jan 2009
Reputation Points: 120
Solved Threads: 152
Skill Endorsements: 1