---------------------js代碼
function add1(str, id) {
var txt = parseInt(document.getElementById("Text_" + id).value);//shuliang
var price = document.getElementById("price_" + id).value;//jige
if (str == "+") {
txt = txt + 1;
}
else if (str == "-") {
txt = txt - 1;
}
var t = $("#Text_" + id); //改變一個(gè)txt的值
t.val(txt);
var tmoy = (parseInt(txt) * parseFloat(price)).toFixed(2);
document.getElementById("totalMoney").innerHTML = "¥" + tmoy
document.getElementById("totalNum").innerHTML = t.val();
document.getElementById("total").innerHTML = t.val();
}
----------------------------html代碼
<div class="shopCart_main_con_goods_num_jian">聯(lián)系客服