winter3000
2016-03-19 23:53
这两个clock是“同一个”吗?因为我把函数名改了好像没有影响?
var attime;
function co(){
var time=new Date();
attime=time.getHours()+":"+time.getMinutes()+":"+time.getSeconds();
document.getElementById("clock").value = attime;
}
var int=setInterval(co,100);
不是同一个 getElementById(); 注意后半段 ById(). 说明里面是某个标签的ID。 跟函数名无关
JavaScript进阶篇
469057 学习 · 22582 问题
相似问题