Am having two divs with same class name so when am attaching an element by creating id for both the divs, am getting the element id name as same for both the elements in both divs.
Example:
<div class="nav">
<div class="example" id="example_1">
</div>
</div>
<div class="nav">
<div class="example" id="example_2">
</div>
</div>
and I have used jquery syntax as
$(".nav").append(example)
where example_i increments.
How can I make different ids using jquery?