I want to check whether an a
node contains开发者_JS百科 the word "B". If so, the node's someclass
class should be removed.
For example:
<a href="http://link.com" class="someclass">B</a>
$("a:contains('B')").removeClass('someclass');
$('a').click(function(){
var text = $(this).text();
if(text.indexOf("B")>= 0 ) {
$(this).removClass('someclass');
}
});
精彩评论