title: jQuery: clone a div and insert it after last div with sequential id
body: <p>I need to insert a clone of a <code>div</code> containing a <code>form</code> after the last <code>div</code> with that same class. But how can I empty all the form fields? I have the following code:</p>
  
  <pre><code>&lt;span id="add"&gt;Add&lt;/span&gt;
  &lt;div id="0" class="addr"&gt;
      &lt;input type="text" name="a"&gt;
      &lt;input type="text" name="b"&gt;
      &lt;input type="text" name="c"&gt;
  &lt;/div&gt;
  &lt;script&gt;
      jQuery(document).ready(function($){
          $('#add').on('click',function() {
              var id = $(".addr:last").attr('id');
              $(".addr:last").clone().attr('id', ++id).insertAfter(".addr:last");
          });
      });
  &lt;/script&gt;
  </code></pre>