Does anyone know if there's an equivalence selector in jQuery? Of course :contains
exist, but what if we want exact matches?
My workaround is to do
$('a').filter(function() {
return $(this).text() == myVar;
}).addClass('highlight');
But I was hoping of a much easier method of doing $('a:equals(' + myVar + ')').addClass('highlight')
instead. Of course I could create the selector, but I'd have assumed something exists in the standard library.
Cheers