8-5 点击开始计算为什么只会闪烁下0,就没有了
<!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>