title: Increment attribute value (int) for each element using jquery
body: <p>i have an unknown number of section elements:</p>
  
  <pre><code>&lt;section id="foo"&gt;
  ...
  &lt;/section&gt;
  
  &lt;section id="bar"&gt;
  ...
  &lt;/section&gt;
  </code></pre>
  
  <p>For each section which is present I need to add an attribute "data-serial" which is an integer starting at 0 and being incremented by 1 for each section present, for example the above would turn into:</p>
  
  <pre><code>&lt;section id="foo" data-serial="0"&gt;
  ...
  &lt;/section&gt;
  
  &lt;section id="bar" data-serial="1"&gt;
  ...
  &lt;/section&gt;
  
  &lt;section id="bla" data-serial="2"&gt;
  ...
  &lt;/section&gt;
  ...
  </code></pre>
  
  <p>How can I achieve this using jQuery?</p>
  
  <p>Thanks</p>