I need to show each number of div in the page in order
And add the value of each div inside span
so if I have 4 divs inside page like this
Simple each loop does the trick:
each
$("div").each(function(i) { $(this).find("span").text(++i); });
Demo: http://jsfiddle.net/CtDLe/3/