Geoff Appleford Geoff Appleford - 1 month ago 7
HTML Question

How to select all anchor tags with specific text

Given multiple anchor tags:

<a class="myclass" href="...">My Text</a>

How do I select the anchors matching the class and with some specific text. eg Select all anchors with the class:'myclass' and text:'My Text'

$("a.myclass:contains('My Text')")