<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>计时器</title>
</head>
<script type="text/javascript">
var num=0;
function startCount() {
document.getElementById('count').value=num;
num=num+1;
setTimeout("startCount()",1000);
}
//执行一次就完了啊,为什么是无限循环,用按钮跟这行再写setTimeout 有什么区别??
</script>
</head>
<body>
<form>
<input type="text" id="count" />
<input type="button" value="Start" onClick="startCount()" />
</form>
</body>
</html>
setTimeout("startCount()",1000);方法中参数错了吧,貌似是 setTimeout("startCount",1000)这样 的