為什么這段作數(shù)量增加的代碼運(yùn)行無反應(yīng)
var addd = document.getElementsByClassName("add");
for(var n=0;n<addd.length;n++){
addd[n].onclick=function(){
var j = document.getElementsByClassName("count-input")[n];
var h = parseInt(j.value)
j.value=h+1;
}
var addd = document.getElementsByClassName("add");
for(var n=0;n<addd.length;n++){
addd[n].onclick=function(){
var j = document.getElementsByClassName("count-input")[n];
var h = parseInt(j.value)
j.value=h+1;
}
2018-04-04
舉報(bào)
2018-04-14
有反應(yīng)呀