Need to convert result of [removed] to number on javascript

后端 未结 2 623
难免孤独
难免孤独 2021-02-10 11:07

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; });
    

提交回复
热议问题