为什么不是隔6秒显示,不知道错在哪儿,求指导 var attime; function clock(){ var time=new Date(); attime= [time.getHours(),time.getMinutes(),time.getSeconds()].join(":"); document.getElementById("clock").value = attime; } var int = setInterval(c
为什么不是隔6秒显示,不知道错在哪儿,求指导
var attime;
function clock(){
var time=new Date();
attime= [time.getHours(),time.getMinutes(),time.getSeconds()].join(":");
document.getElementById("clock").value = attime;
}
var int = setInterval(clock,1000*6);
document.getElementById("clock").value = attime;
}
var int = setInterval(clock,1000*5);