I want to push and plus value in array. I tried it but it is giving 'NaN'. I think it can be done by defining array type to integer. Can it is possible. Fiddle here.
var total=[];
$('.check').each(function(index, element) {
$(this).find('div').each(function(index, element) {
total[index]+= parseInt($(this).text())
});
});
$('.update').find('div').each(function(index, element) {
$(this).text(total[index])
});
+=on an empty array, so it's trying to take nothing and add to it, henceNaN