居食网
您的当前位置:首页JS通过相同的name进行表格求和代码_javascript技巧

JS通过相同的name进行表格求和代码_javascript技巧

来源:居食网


代码如下:
$("input[name=productNeedNum]").each(function(){
var productNeedNum=document.getElementById("productNeedNum").value;
var NumTotal += productNeedNum;
document.getElementById("NumTotal").value=NumTotal;
});
显示全文