×

JQuery 操作/获取table具体代码

作者:Terry2017.02.11来源:Web前端之家浏览:9577评论:0
关键词:JQueryJS
//nav_box 表格名称
复制代码 代码如下:

$("#nav_box tr").each(function (i) {
//var text = $(this).children("td:first").text();
//var proid = $(this).find("input:hidden").val();
//alert("proid==" + i + "===" + proid);
var num = $("#ProNum" + i).val(); //数量
var price = $("#Price" + i).val();//价格
var percent = $("#Percent" + i).val(); //折扣
var discountAmount = percent * price; //折扣价
$("#discountAmount" + i).val(discountAmount.toFixed(2)) //折扣价格
var total = discountAmount * num; //小计=折扣价*数量
$("#Total" + i).val(total.toFixed(2)); //小计
});

您的支持是我们创作的动力!
温馨提示:本文作者系Terry ,经Web前端之家编辑修改或补充,转载请注明出处和本文链接:
https://jiangweishan.com/article/svg1486742400541.html

网友评论文明上网理性发言已有0人参与

发表评论: