1
Good morning gentlemen,
I need to count elements of a li and add these values dynamically by counting the previous li elements:
<div class="conteudo">
<ul>
<li><i class="indice">1 - </i>Conteudo 1</li>
<li><i class="indice">2 - </i>Conteudo 2</li>
<li><i class="indice">3 - </i>Conteudo 3</li>
<li><i class="indice">4 - </i>Conteudo 4</li>
<li><i class="indice">5 - </i>Conteudo 5</li>
<li><i class="indice">6 - </i>Conteudo 6</li>
</ul>
</div>
uses each and addClass() http://api.jquery.com/each/ http://api.jquery.com/addClass/
– periotto
Good day periotto, does each count the right elements? if yes, my doubt is how I would make him count only the previous elements and pass this value to the . Indice! Hug!
– Jeferson Kaefer