Delete class for all children
Given the following HTML:
<div id="table-filters"> <ul> <li class="active">blah</li> <li>blah</li> <li>blah</li> <li>blah</li> </ul> </div> Using table filters as a jQuery selector, how can I remove elements that have CLASS=ACTIVE , no matter what LI it is on?
thank
+52
AnApprentice Jan 09 '10 at 19:56 2010-01-09 19:56
source share2 answers
This should work:
$("#table-filters>ul>li.active").removeClass("active"); //Find all `li`s with class `active`, children of `ul`s, children of `table-filters` +95
Joel Jan 09 '10 at 19:58 2010-01-09 19:58
source shareYou can also do the following:
$("#table-filters li").parent().find('li').removeClass("active"); +25
insomiac Jun 07 '12 at 1:10 2012-06-07 01:10
source share