How do I select the nodes that have <a name=”something”></a>, so that I can bold its contained text?
<p>
<a name="test"></a>
Test 1
</p>
<p>
<a href="test2"></a>
Test 2
</p>
<div>
<a name="test3"></a>
Test 3
</div>
Desired output:
Test 1
Test 2
Test 3
You can use
.has()method:or
:has()selector:DEMO: http://jsfiddle.net/bWvwa/