title: jQuery Sum table td and allow only 100 total
body: <p>I want to sum table columns of class total of all the table rows. and display the total at the last row also I want to allow only total=100 to submit the form otherwise an error message will be shown.</p>
  
  <p>I found below code and I tried to change it but its not working:</p>
  
  <p>Code</p>
  
  <pre><code>    $(document).on("input", "input:text", function () {
          var strClass = $(this).prop("class");
          var intTotal = 0;
          $.each($("input:text." + strClass), function () {
              var intInputValue = parseInt($(this).val());
              if (!isNaN(intInputValue))
              {
                  intTotal = intTotal + intInputValue;
              }
          });
          $(this).parent("tr").siblings("td").text(intTotal);
      });
  </code></pre>
  
  <p><br /></p>
  
  <pre><code>&lt;table&gt;
    &lt;tr&gt;
      &lt;td&gt;Size 1&lt;/td&gt;
      &lt;td&gt;&lt;input type="text" class="productA"&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Size 2&lt;/td&gt;
      &lt;td&gt;&lt;input type="text" class="productA"&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Size 3&lt;/td&gt;
      &lt;td&gt;&lt;input type="text" class="productA"&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;TOTAL&lt;/td&gt;
      &lt;td&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p><a href="https://jsfiddle.net/Somayah/1njcq99v/10/" rel="nofollow noreferrer">jsfiddle</a></p>
  
  <p><strong><em>Please advise</em></strong></p>