I have a html that contains tables like the following example
2条回答 感情败类 (楼主) 2021-02-10 11:24 Try something like this, using a more functional approach: var sum = [].map.call(valuelements, function(v) { return +v.textContent; }).reduce(function(a, b) { return a + b; }); 0 讨论(0) 查看其它2个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复 热议问题
Try something like this, using a more functional approach:
var sum = [].map.call(valuelements, function(v) { return +v.textContent; }).reduce(function(a, b) { return a + b; });