title: giving id to many objects - is it a bad idea?
body: <p>I was working on a django project and soon the template became a mess and ended up with nearly all elements having an ID (just to clarify, <strong>all IDs are unique</strong>). I can reduce the number of IDs by giving their parents  an ID but that would increase my jQuery code. So what I am asking is</p>
  
  <blockquote>
    <p>Is it better to have many IDs in HTML <strong>or</strong> slightly less IDs and a bit longer JS/jQuery code?</p>
  </blockquote>
  
  <p>Here's a sample code:</p>
  
  <pre><code>&lt;ol&gt;
      &lt;li&gt;
          &lt;p&gt;
              &lt;a href="/vote/" class="vote" id="story-vote-26"&gt;&lt;img src="/static/images/arrow.gif"&gt;&lt;/a&gt;
              &lt;a href="http://www.lettersofnote.com/2012/10/people-simply-empty-out.html" class="title" id="story-title-26"&gt;“People simply empty out”&lt;/a&gt; &lt;span class="domain"&gt;(www.lettersofnote.com)&lt;/span&gt;
          &lt;/p&gt;
          &lt;p class="story-info"&gt;
              &lt;span id="story-points-26"&gt;660&lt;/span&gt; points by tantaman &amp;#448; 31 minutess ago
          &lt;/p&gt;
      &lt;/li&gt;
      ...
  </code></pre>
  
  <p>there are at least 100 of these <code>li</code> and each with 4 IDs (I haven't added 4th one yet). So total of 400 IDs, or 100 IDs if I add ID to <code>li</code>s instead</p>