Tuesday, 6 August 2013

finding and selecting the correct class

finding and selecting the correct class

I need to select .foo, however, there are two a tags with .foo, and I need
to select the one only with .foo, and not the one with .foo.bar, how do I
accomplish this?
<a class="foo bar">text</a>
<a class="foo">text</a>
the code I'm using to find .foo is
$(this).parents('.post').find('.foo').text('text');

No comments:

Post a Comment