I can get the sum of a certain value in a table bay using this code..
$(calculateSum);
function calculateSum() {
var sum = 0;
//iterate through each td based on class and add the values
$(".d").each(function() {
var value = $(this).text();
//add only if the value is number
if(!isNaN(value) && value.length!=0) {
sum += parseFloat(value);
}
});
$('#result').text(sum);
};
And my table Have Value 12
Now,I have 5 tables in a html and each table has a td element which values differs from each other,Whats the best way to get those values in javascript?
.findto get the innertds