<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>计时器</title>
<script type="text/javascript">
// var num=0;
// function startCount() {
// document.getElementById('count').value=num;
// num=num+1;
// }
var num=0;
function countNum(){
document.getElementById("count").value=num;
num++;
setTimeout("countNum()",1000);
}
</script>
</head>
<body>
<form>
<input type="text" id="count" onclick="countNum()"/>
</form>
</body>
</html>
不用这一句啊,你上面的就可以完成,点一下输入框
<input type="submit" value="开始计数" onClick="countNum()">
这句忘写了