title: Jquery: Dynamic adding <id> depending on <div>
body: <p>Let's dynamically add IDs on our DIV tag, depending on the number of DIVs</p>
  
  <pre><code>&lt;div class="panel" id=""&gt;
    ...
    ...
  &lt;/div&gt;
  &lt;div class="panel" id=""&gt;
    ...
    ...
  &lt;/div&gt;
  &lt;div class="panel" id=""&gt;
    ...
    ...
  &lt;/div&gt;
  </code></pre>
  
  <p>the result that we would like to achieve is using jquery</p>
  
  <pre><code>&lt;div class="panel" id="1"&gt;
    ...
    ...
  &lt;/div&gt;
  &lt;div class="panel" id="2"&gt;
    ...
    ...
  &lt;/div&gt;
  &lt;div class="panel" id="3"&gt;
    ...
    ...
  &lt;/div&gt;
  </code></pre>
  
  <p>i tried to do a code like this but it is not working</p>
  
  <pre><code>$panel.each(function(i) {
    $(this).attr('id', ($(i+1)));
  </code></pre>