need to generate unlimited number of unique id's with jQuery
- by jquery n00b
Hi all,
extreme n00b here... I've got a number of elements (dynamically generated by back end so it could be quite a few) and all need a unique id. I'm trying to work out how to do this wth jQuery and not doing so well. Any help is appreciated.
In the code below, I'd want each "bar" div to get a unique id, like id1, id2 etc etc
<div class="foo">
<ul class="bar">
</ul>
<ul class="bar">
</ul>
<ul class="bar">
</ul>
<ul class="bar">
</ul>
</div>