码迷,mamicode.com
首页 > 其他好文 > 详细

一个时间

时间:2017-04-24 09:58:13      阅读:127      评论:0      收藏:0      [点我收藏+]

标签:val   timeout   set   oct   ptime   title   nbsp   time   mint   

<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8">
<title></title>
</head>

<body>
<input type="button" value="开始计时" onclick="timeout"> 分钟
<form name="a">
<input type="text" value="0" name="minture"></form>

<form name="b">
<input type="text" value="0" name="second"></form>
<input type="button" value="停止计时" onclick="stoptime">

</body>

</html>
<script>
var x = -1;
y = -1;

function countMin() {
y=y+1;
var n=y%60;
document.a.minture.value = n;
setTimeout("countMin()", 1000 * 60)
}

 

function countsec() {
x = x + 1;
var z = x % 60
document.b.second.value = z;
setTimeout("countsec()", 1000)
}

countMin()
countsec()
</script>

一个时间

标签:val   timeout   set   oct   ptime   title   nbsp   time   mint   

原文地址:http://www.cnblogs.com/xieyunhuaxiang/p/6755078.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!