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

If you are comfortable with jQuery, then jquery filter() can be implemented easily.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.