为什么这段作数量增加的代码运行无反应
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
举报