Hi All, Using jquery I want to add an id to a series of divs, but of course the ids need to be always different, so I thought to have a progressive number like id="1", id="2", id="3" etc.
here's my markup:
content
<div class="box">
<p>
content
</p>
</div>
<div class="box">
<p>
content
</p>
</div>
<div class="box">
<p>
content
</p>
</div>
I tried an .each() loop but I don't know what to pass as collection (maybe $('.box').lenght()? but returns a number not a collection) and how to implement the callback function. any help please?
Thanks in advance :)
Mauro