Home  >  Article  >  Web Front-end  >  JQuery 操作/获取table具体代码_jquery

JQuery 操作/获取table具体代码_jquery

WBOY
WBOYOriginal
2016-05-16 17:32:271180browse

//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)); //小计
});
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn