Is there any way - any jQuery selector (I did not find it at http://api.jquery.com/category/selectors/ ) that can be used as an exact match?
: contains () is almost what I need, but not really. ": contains" a search in each element of the regular expression as follows:
.*<query>.*
This means that if I need to find a link that looks something like this:
<a href="#">Baxter</a>
And use this:
$("a:contains('Baxter')")
It also matches this, which I don't want to match:
<a href="#">I'm Peter Baxter, how are you?</a>
I know that I can just take all the elements and compare their contents in a loop, but I want to be sure that there is no simpler way.
javascript jquery
Radek Simko
source share