function clock(){
var time=new Date();
document.getElementById("clock").value = time;
}
val i=setInterval("clock()",1000);
</script>
</head>
<body>
<form>
<input type="text" id="clock" size="50" />
<input type="button" value="Stop" onclick="clearInterval(i)" />
i前面的var写错了,你写的是val