I have a list of 20+ items. The background-color changes using the :nth-child(2n+1) selector. (ie. even item black, odd item white). When I click a button to filter out spec
Nth-child can be counterintuitive when working with a filtered selection of a group.
Use .each() to get around its limitations:
var count = 1; $('#element tr:not(.isotope-hidden)').each(function(){ if ( count++ % 2 == 1 ) $(this).css('background-color','white') })