标签:
<!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;//为text文本框赋值
num=num+1;
setTimeout("startCount()",1000);//设置计数间隔为一秒
}
setTimeout("startCount()",5000);//网页加载后五秒钟 开始计数
</script>
</head>
<body>
<form>
<input type="text" id="count" />
</form>
</body>
</html>
标签:
原文地址:http://www.cnblogs.com/liangxiaoyu/p/4905919.html