This question is an exact duplicate of:
How to do each summation of class three of the products.
Here is my similar work.
How to do summation of product of two input values from a clone table input values
$("table").on("change", "input", function() { //use event delegation
var tableRow = $(this).closest("tr"); //from input find row
var one = Number(tableRow.find(".one").val()); //get first textbox
var two = Number(tableRow.find(".two").val()); //get second textbox
var total = one * two; //calculate total
tableRow.find(".three").val(total); //set value
});
$("button.add").on("click", function() {
var tbody = $("table tbody");
tbody.find("tr:eq(0)").clone().appendTo(tbody).find("input").val("");
});
function updateTotalOfSubTotal() {
var totalPoints = 0;
var tableRow = $(this).closest("tr");
var test = tableRow.find(".three").val();
totalPoints += test;
console.log(totalPoints);
}
updateTotalOfSubTotal();
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<table>
<tbody>
<tr>
<td><input class="one" /></td>
<td><input class="two" /></td>
<td><input class="three" readonly="readonly" /></td>
</tr>
</tbody>
</table>
<button class="add">Add</button>
This works - note the keyup and the loop over .subTotal every time, not just first time
I have cleaned the code and use the HTML from your other question