计时器
来源:互联网 发布:舞蹈软件哪个好 编辑:程序博客网 时间:2024/06/06 20:21
<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)
}
</script>
</head>
<body>
<form>
<input type="button" value="开始计时!" onClick="timedCount()">
<input type="text" id="txt">
<input type="button" value="停止计时!" onClick="stopCount()">
</form>
<p>
请点击上面的“开始计时”按钮。输入框会从 0 开始一直进行计时。点击“停止计时”可停止计时。
</p>
</body>
</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)
}
</script>
</head>
<body>
<form>
<input type="button" value="开始计时!" onClick="timedCount()">
<input type="text" id="txt">
<input type="button" value="停止计时!" onClick="stopCount()">
</form>
<p>
请点击上面的“开始计时”按钮。输入框会从 0 开始一直进行计时。点击“停止计时”可停止计时。
</p>
</body>
</html>
0 0
- 计时器
- 计时器
- 计时器
- 计时器
- 计时器
- 计时器
- 计时器
- 计时器
- 计时器
- 计时器
- 计时器
- 计时器
- 计时器
- 计时器
- 计时器
- 计时器
- 计时器
- 计时器
- java读取xml配置文件
- 《深入分析JavaWeb技术内幕》读书笔记六.JVM
- git error: unable to write file "xxx"
- maven 打包时,包含xml等配置文件
- mac机安装cordova开发H5跨平台app应用
- 计时器
- fragment 只有第一次加载数据其他时候不加载更新数据
- hdu 4787 GRE Words Revenge(在线AC自动机)
- Xshell操作linux上传与下载
- 性能测试类型
- 文章标题
- react-native学习路线总结
- CSS + DIV 让页脚始终底部
- 【建站】阿里云服务器 Ubuntu + django + nginx建站