//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)); //小計
});