Can anyone help me figure out how to calculate the total sum of the values entered using IDs?
I've been struggling with it and can't seem to get it to work.
Your assistance would be greatly appreciated.
<input type="number" id="do" name="i1">
<input type="number" id="to" name="i2">
$("#do").keyup(function() {
var totalSum = 0;
$("#to").each(function() {
totalSum += Number($(this).val());
});
$('#total-amount').text(totalSum + ' usd');
});