时间没有动态显示呀?为什么,而且按钮点击后就不见了,为什么,求大神指教。
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>定时器</title>
<script type="text/javascript">
function clock(){
var mydate=new Date();
atime=mydate.getHours()+":"+mydate.getMinutes()+":"+mydate.getSeconds()
document.write(atime);
document.getElementById("clock").value = atime;
}
setInterval(clock, 1000);
</script>
</head>
<body>
<form>
<input type="button" value="点击我啊" onclick="clock()" />
</form>
</body>
</html>