I want to get the exact tag (not parents) that matching jquery selector. this is my code:
var tagList = $('div:contains("Hello")');
alert(tagList.length);
this selector returns a list of tag (length is 4) that are all parent div of matching tag.
<div>
<div>
<div>
<div> Hello </div> //I want to get only this element
</div>
</div>
<div> //I also tried to get deepest children but result contains this siblings of parents too.
</div>
</div>
How to reduce result to only one element that matching the rule.