<div class="testDivClass">
Some text!
<div>
<span class="testSpanClass">
</span>
</div>
</div>
I want to return true or an object that’s not null (basically a boolean to test) – which tells me that this div (of class testDivClass) does contains ‘Some text!’ and does have a span of class “testSpanClass” (which, please note, is not a direct child of the ‘root’ div).
Thanks a lot for any suggestions.
So far I have:
$("div.testDivClass:contains('Some text!')");
which is fine, but I don’t know where to go from here. Using .children(".testSpanClass") gives me nothing.
EDIT: I’ve tried .has() – that too returns nothing.
Demo: http://jsfiddle.net/Y2KVp/
With selector:
Selector demo: http://jsfiddle.net/Y2KVp/2/