I have this function:
$containing = jQuery('#test a').filter(function(){
return jQuery(this).text().substring(0,2) == "Ba";
});
if ($containing.length > 0) {
$containing.first().addClass('testtt');
}
This adds the class
to the first anchor it finds, but that's not what I want. I wanted to give the class to all the anchors
containing Ba... I tried replacing first
with each
, but nothing happened at all. Can someone help me out?