Does anyone know if there is an equivalence selector in jQuery? Of course it :containsdoes, 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 for a much simpler way to do $('a:equals(' + myVar + ')').addClass('highlight'). Of course, I could create a selector, but I assumed that something exists in the standard library.
Greetings
source
share