jQuery/JavaScript: Avoid unique ID's for each row in a table?
<p>I'm not sure if I'm doing this the right way. I have table which I fill with rows that each represent a song in a playlist. Right now, I assign a unique ID per row, and also assign som jQuery.data() to each ID.</p>

<pre><code>        html += '\
            &lt;tr id="track-' + i + '" class="tracks-row"&gt; \
                &lt;td class="track"&gt;&lt;a id="play-'+ i +'" class="play"&gt;&lt;/a&gt;&lt;a id="play2-' + i + '"&gt;' + song.song_track + '&lt;span class="mix-style"&gt;' + song_mix + '&lt;/span&gt;&lt;/a&gt;&lt;/td&gt; \
                &lt;td class="artist"&gt;' + song.song_artist + '&lt;/td&gt; \
                &lt;td class="favourites-holder"&gt;&lt;a id="favourite-' + i + '" class="favourites"&gt;&lt;/a&gt;&lt;/td&gt; \
                ' + delete_holder + ' \
            &lt;/tr&gt; \
        ';
</code></pre>

<p>So as you can see, each row has an ID like track-1, track-2 etc.</p>

<p>Is there another way to populate a playlist like this without assigning unique ID's to each track, or is this how it's supposed to be done? Each track has some properties like this:</p>

<pre><code>        $("#track-" + i).data("song_id", song.song_id);
        $("#track-" + i).data("song_artist", song.song_artist);
        $("#track-" + i).data("song_track", song.song_track);
        $("#track-" + i).data("song_mix", song.song_mix);
        $("#track-" + i).data("ps_id", song.ps_id);
</code></pre>

<p>... and also .click events for each track, which allows the user to play, sort, drag etc... It just feels like I'm doing it wrong :)?</p>
