重复声明变量
var num = 0,i; function startCount(){ document.getElementById("count").value = num; num += 1; i = setTimeout("startCount()",100); } function stopCount(){ clearTimeout(i); } 这样是ok的,但是把六行的i前面加上var,即var i = setTimeout("startCount()",100);就有问题呢?
2016-06-22
举报