Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想获得一些值的总数和平均值,但我已经坚持启动 jQuery。这是因为我想要的值在同一张表中。
有人可以帮我从这个开始吗?
我的例子:http: //jsbin.com/inapey/2/edit
$(document).ready(function(){ var total = 0; $('#ritten tr .single_ride').each(function() { var ritkm = $(this).html(); total = total + parseInt(ritkm); }); alert(total); });