I am trying to create counting function with jquery.
I have multiple sets of inputs with numbers determined, something like:
<input class="price" type="hidden" name="price" value="4">
<input class="count" type="text" name="count" maxlength="4">
I want to create script that will count all inputs, eg.
(price * count) + (price * count) etc..
So far i came up with this script, which multiplies and displays only one input
$('.count').blur(function() {
var amount = parseFloat($(this).val());
var price = $(this).closest('tr').find('.price');
var result = parseFloat((price).val());
var money = (amount * result)
$('.money').text(money);
});
.priceand.countelements are grouped in order to iterate over them.