理由は聞かないでください。ただし、<li>
要素の横にコンテンツがある要素にクラスゼブラを追加する必要があります。これは私が持っている限りですが、どの計算を使用するかわかりません:
$("li").each(function(index){
if(index % ??? == 0) { // <-- not sure what to put here
}
});
<ul>
<li></li>
<li></li>
<li></li> <!-- add the zebra class here -->
<li></li>
<li></li>
<li></li>
<li></li> <!-- add the zebra class here -->
<li></li>
<li></li>
<li></li>
<li></li> <!-- add the zebra class here -->
<li></li>
</ul>
誰か助けてもらえますか?