<title>定时器</title>
<script type="text/javascript">
var attime;
function clock(){
var time=new Date();
attime= time.getHours() + ":" +time.getMinutes() + ":" +time.getSeconds();
document.getElementById("clock").value = attime;
}
int = setInterval(clock, 100)
</script>
</head>
<body>
<form>
<input type="text" id="clock" size="50" />
</form>在对attime赋值时,如果不加中间的分号,form表单中只显示最后的秒数,为什么啊
添加回答
举报
0/150
提交
取消