Geoff Appleford Geoff Appleford - 1 year ago 53
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'

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