Modulo jquery question

Posted by chchrist on Stack Overflow See other posts from Stack Overflow or by chchrist
Published on 2010-06-18T09:22:24Z Indexed on 2010/06/18 9:33 UTC
Read the original article Hit count: 185

Filed under:
|

Hi all,

Dont ask why but I need to add class zebra to the lis with the content next to them. I do a

$("li").each(function(index){

if(index%??? == 0) {

}

});

<ul>
<li></li>
<li></li>
<li></li> //add here class zebra
<li></li>
<li></li>
<li></li>
<li></li> //add here class zebra
<li></li>
<li></li>
<li></li>
<li></li> //add here class zebra
<li></li>
</ul>

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about modulo