标签: javascript web
function change(id) { var i = findpos(id); totalprice += (parseInt($('#' + id + '_cnt').val()) - purchased[i].cnt) * purchased[i].price; purchased[i].cnt = parseInt($('#' + id + '_cnt').val()); update_total(); }