为什么我的代码不显示时间呢
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>定时器</title>
<script type="text/javascript">
function clock(){
var attime;
var time=new Date();
var h=time.getHours();
var m=time.getMinutes();
var s=time.getSeconds();
m=checkTime(m);
s=checkTime(s);
attime=h+":"+m+":"+s;
document.getElementById("clock").value = attime;
setInterval("clock()",100);
}
function checkTime(i){
if(i<10){
i="0"+i;
}
return i;
}
</script>
</head>
<body>
<form>
<input type="text" id="clock" size="50" />
<input type="button" onclick="clock()" value="显示时间" />
</form>
</body>
</html>