I have the following block of jQuery code that I'm using to copy some html from one place to another:
var newLine  = $('#popup-clone .popup-contents').last().clone();
newLine.find('.popup-title').html("hello world");
$('#popup-container').append(newLine);
this runs in a loop several times so the html gets rendered like this:
    <div id="popup-container" style="display: block;">
        <div class="popup-contents">
            <a class="close">close this popup</a>
            <span class="popup-title">Title 1</span>
            <span class="popup-description"></span>
            <span class="popup-type"></span>
            <span class="popup-open"></span>
        </div>
        <div class="popup-contents">
            <a class="close">close this popup</a>
            <span class="popup-title">Title 2</span>
            <span class="popup-description"></span>
            <span class="popup-type"></span>
            <span class="popup-open"></span>
        </div>
    </div>
and so on
I want to add a unique ID to every div with class="popup-contents" but i'm not sure how i can do that? Any help is appreciated.
 
     
     
     
     
    