title: Get the sum of textbox fields value per row
body: <p>I have here shopping cart using php. I add a script for getting the sum of all input fields. What I need to do is get the sum of all quarter per row. The problem is all of total fields gets the sum value of row. How I can get the sum per row?</p>
  
  <p><img src="https://i.stack.imgur.com/9Ic4A.jpg" alt="enter image description here"></p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $('.qtys').blur(function() {
      var sum = 0;
      $('.qtys').each(function() {
      sum += Number($(this).val());
      });
      $('.qty_total').val(sum);
  });
  &lt;/script&gt;
  
  while($obj = $results-&gt;fetch_object())
  {
  &lt;td&gt;&lt;input type="text" name="product_qty" size="1" class="qty_total"/&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input type="text" name="qty1st" size="1" class="qtys"/&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input type="text" name="qty2nd" size="1" class="qtys"/&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input type="text" name="qty3rd" size="1" class="qtys"/&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input type="text" name="qty4th" size="1" class="qtys"/&gt;&lt;/td&gt;
  }
  </code></pre>