I have an order form with about 30 text fields that contain numerical values. I\'d like to calculate the sum of all those values on blur.
I know how to select all te
$('.price').blur(function () { var sum = 0; $('.price').each(function() { if($(this).val()!="") { sum += parseFloat($(this).val()); } }); alert(sum); });
JS Fiddle