2
I would like to list all Ivs with spans of id="position" to simulate a classification.
Ex:
<div id="conteudo">
<div id="time"><span id="posicao">1.</span> Nome1</div>
<div id="time"><span id="posicao">2.</span> Nome2</div>
<div id="time"><span id="posicao">3.</span> Nome3</div>
<div id="time"><span id="posicao">N.</span> NomeN</div>
</div>
I tried to generate in this way:
var divs = $("#conteudo").find("#posicao").toArray();
$.each(divs, function (index, value) {
$("#posicao").append((index+1)+".");
});
But the numbers were only generated in the first span of id="position".
The expected result is this HTML snippet? You want to include this content in
<span>
is?– Bruno César