title: jquery .each() add individual attribute to a div
body: <p>On load, i am looking to add a data-slide attribute number to each div found of the same class</p>
  
  <p>for example:</p>
  
  <pre><code>&lt;div class='slide' data-slide=''&gt;&lt;/div&gt;
  &lt;div class='slide' data-slide=''&gt;&lt;/div&gt;
  &lt;div class='slide' data-slide=''&gt;&lt;/div&gt;
  </code></pre>
  
  <p>I am trying using the following code, however all it does is take the lnumber found rather than the index:</p>
  
  <pre><code>$( ".slide" ).each(function( index ) {
  $('.slide').attr( 'data-slide',''+index+'');
  });
  </code></pre>
  
  <p>I would like it to produce the following:</p>
  
  <pre><code>&lt;div class='slide' data-slide='1'&gt;&lt;/div&gt;
  &lt;div class='slide' data-slide='2'&gt;&lt;/div&gt;
  &lt;div class='slide' data-slide='3'&gt;&lt;/div&gt;
  </code></pre>
  
  <p>ANy ideas please?</p>