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
Similarly along the lines of these answers written as a plugin:
$.fn.sum = function () { var sum = 0; this.each(function () { sum += 1*($(this).val()); }); return sum; };
For the record 1 * x is faster than Number(x) in Chrome