这段代码有什么问题我似乎收到了一个错误,即未定义计时器
var counter = setInterval("timer()",1000);
function timer(){
count = count-1;
if(count <=0){
clearInterval(counter);
return;
}
document.getElementById("timer").innerHTML = count + " sec";
}