js 数量加减按钮的function
functionsubNum(id){vargetNum=parseInt(num.value);if(getNum>1){num.value=getNum-1;}}fu...
function subNum(id) {
var getNum = parseInt(num.value);
if(getNum > 1){
num.value = getNum - 1;
}
}
function addNum(id){
var num = document.getElementById("num" + id);
num.value = parseInt(num.value) + 1;
}
减号的按钮减不了 展开
var getNum = parseInt(num.value);
if(getNum > 1){
num.value = getNum - 1;
}
}
function addNum(id){
var num = document.getElementById("num" + id);
num.value = parseInt(num.value) + 1;
}
减号的按钮减不了 展开
1个回答
展开全部
function subNum(id) {
var num = document.getElementById("num" + id);
var getNum = parseInt(num.value);
if(getNum > 1){
num.value = getNum - 1;
}
}
function addNum(id){
var num = document.getElementById("num" + id);
num.value = parseInt(num.value) + 1;
}
或者
var num = document.getElementById("num" + id);
function subNum(id) {
var getNum = parseInt(num.value);
if(getNum > 1){
num.value = getNum - 1;
}
}
function addNum(id){
num.value = parseInt(num.value) + 1;
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询