title: Serial Number for dynamic table using jQuery
body: <p>I have a dynamic table which has 2 dynamic rows .i.e students and their subjects and marks. The code is below : </p>
  
  <p><a href="https://jsfiddle.net/soumyar/ou6sz83u/" rel="nofollow noreferrer"><strong>Click here to view the code</strong></a> </p>
  
  <blockquote>
    <p><strong>Code for Serial Number</strong></p>
  </blockquote>
  
  <pre><code> function numberRows() {
        $('input[name^="SNo"]').each(function(i) {
              $(this).val(i + 1);
        });
          }
      numberRows();
  </code></pre>
  
  <blockquote>
    <p><strong>Output that comes :</strong> </p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/iDOvl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iDOvl.png" alt="enter image description here"></a></p>
  
  <blockquote>
    <p><strong>Output expected</strong></p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/lw88I.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lw88I.png" alt="enter image description here"></a></p>
  
  <p>The serial numbers are not generated dynamically. Where could I have possibly gone wrong? Would appreciate any help/ suggestions! :)</p>