5
The problem is, I’m 9 li
within a ul
<ul>
<li>Teste1</li>
<li>Teste2</li>
<li>Teste3</li>
<li>Teste4</li>
<li>Teste5</li>
<li>Teste6</li>
<li>Teste7</li>
<li>Teste8</li>
<li>Teste9</li>
</ul>
And I’m going through the list that way:
$('li').each(function(index,value){
if(index==0){
$(this).css('color','red');
} else if (index==1){
$(this).css('color','blue');
} else if (index==2){
$(this).css('color','green');
}
})
So far so good, but I wanted to add the colors always in Test 1, Test 4, Test 7, the condition would be i+3 for the red in the example, but I’m not understanding where to put this other one. Would be inside the index?