Home  >  Article  >  Web Front-end  >  JQuery operation/get table specific code_jquery

JQuery operation/get table specific code_jquery

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

//nav_box table name

Copy code The code is as follows:

$("#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() ; //Quantity
var price = $("#Price" i).val(); //Price
var percent = $("#Percent" i).val(); //Discount
var discountAmount = percent * price; //Discount price
$("#discountAmount" i).val(discountAmount.toFixed(2)) //Discount price
var total = discountAmount * num; //Small Total = discount price * quantity
$("#Total" i).val(total.toFixed(2)); //Subtotal
});
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