I am dealing with some generated spans and I would like to find which one of them does not contain any text.
The markup is:
<span id="layer6">
<span class="drag col"> Some text</span>
<span class="drag col"> More text</span>
<span class="drag col"> </span>
<span class="drag col"> I also have text</span>
</span>
I can get get the ones that have "some text" with this code but I can not get the empty ones:
if ($('#layer6 > span.col:contains("some text")').length > 0) {
alert ("I have text");
}
How to get the empty ones? I am thinking in using .length to do it but I did not manage.