title: JQuery to Reset all the indexes after dynamically add or remove rows
body: <p>I am dynamically adding or removing div elements. My sample html would look like:</p>
  
  <pre><code>&lt;!-- 1st dynamic block --&gt;
  &lt;div class="container-fluid well dynamic-wrap"&gt;
  &lt;table class="table table-condensed"&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;LAN&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;&lt;input id="lan-1" name="details[0].lan" value="1" type="text"&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
  &lt;/table&gt;
  &lt;/div&gt;
  &lt;!-- 2nd dynamic block --&gt;
  &lt;div class="container-fluid well dynamic-wrap"&gt;
  &lt;table class="table table-condensed"&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;LAN&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;&lt;input id="lan-1" name="details[0].lan" value="1" type="text"&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
  &lt;/table&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Here, I have added 2nd dynamic block using jquery clone. 
  Now on click of 'Next' button I need to reset the name attribute index before submitting the page.
  So, for 1st and 2nd block name attributes will become
      name="details[0].lan"
      name="details[1].lan"</p>
  
  <p>Please provide some solution how to do this in JQuery.</p>