title: Calculate in table
body: <p>I want to calculate each row in the below <code>table</code> element by using jQuery. How can I do that? </p>
  
  <p><code>a</code> and <code>b</code> have an input element and when I click 'total', the result will appear in "a+b" column.</p>
  
  <p><img src="https://i.stack.imgur.com/6lw5M.png" alt="enter image description here"></p>
  
  <p>This is my code so far:</p>
  
  <pre><code>$("#total").click(function(){
      var a = $(".a").val();
      var b = $(".b").val();
      var tt = a+b;
      $('.a-b').text(tt);
  });
  </code></pre>