jquery contains with class

Posted by proee on Stack Overflow See other posts from Stack Overflow or by proee
Published on 2010-05-07T16:44:09Z Indexed on 2010/05/07 16:48 UTC
Read the original article Hit count: 229

Filed under:
|
|

I'm using jQuery :contains selector to filter through some link tags. The following code works great.

$('a:contains('string').each(function(i){
//do some stuff
});

I'd like only run this function if the anchor tags are inside a specific class, I've tried the following but it does not appear to work:

$('my_class a:contains('string').each(function(i){
//do some stuff
});

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about contains