I am attempting to loop through my array elements, find the sum of them and update a div with the value.
For some reason, my each() loop doesn't work as expected. For example, when I enter 12, 3 times, the answer should be 36, but I get 72.
Any suggestions, thanks!
View full code here: http://jsfiddle.net/lakesmaa/DGPST/3/
$.each(array, function() {
sum += parseInt(this);
});
$('.total').html(sum);
};