The problem is this, I have 9 li
inside 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 browsing the list this 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 always add colors in Test 1, Test 4, Test 7, the condition would be i + 3 for red in the example, however I'm not understanding where to put that other for. Would it be within the index?