2011-04-14 105 views

回答

4
$('.panel a').removeClass('active');//Will remove class 'active' from all elements comes under elements that've class panel 
$('.panel > a').removeClass('active'); // Will remove class only from immediate children 
+0

非凡。做得好 – 2011-04-14 17:17:53

1

你可以試試這個:

$('a.panel').removeClass('active'); 
//removes active from all anchor tags with class panel 
0

你可以這樣做:

var objs = $('.panel'); 

    $.each(objs, function(key, obj){ 
     if(obj.is('a')){ 
      obj.removeClass('active'); 
     } 
    }); 

這是否幫助?