<!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>