title: Iterating over divs with same ID and adding number
body: <p>I am trying to iterate over every div with the the id 'slide' and add a number to the end (e.g slide1, slide2, etc)</p>
  
  <p>I have been able to have a series of classes added to each div, but I can only get the same code to rename the first slide, not the rest of them.</p>
  
  <pre><code>$(document).ready(function() {
   $("#slide").each(function(i) {
      $(this).attr('id', "slide" + (i + 1));
   });
  });​
  </code></pre>
  
  <p>and jsfiddle here <a href="http://jsfiddle.net/YsvCe/1/" rel="nofollow">http://jsfiddle.net/YsvCe/1/</a></p>
  
  <p>Thanks in advance</p>