js 秒表计时器(开始,停止,清零)
<html>
<head>
<script type="text/javascript">
var c=0
var t
function timedCount()
{
document.getElementById(‘txt‘).value=c
c=c+1
t=setTimeout("timedCount()",1000)
}
function stopCount()
{
clearTimeout(t)
}
function cs()
{
c=0
document.getElementById(‘txt‘).value= 0
}
</script>
</head>
<body>
<form>
<input type="button" value="开始!" >
<input type="text">
<input type="button" value="停止!">
<input type="button" value="清零!">
</form>
</body>
</html>
js 秒表计时器(开始,,停止,清零)
温馨提示: 本文由Jm博客推荐,转载请保留链接: https://www.jmwww.net/file/web/42940.html