<html>
<head>
<script language="JavaScript">
var c1 = 0;
var c2 = 0;
var c3 = 0;
var o1 = 0;
var o2 = 0;
var o3 = 0;
ID = window.setTimeout("start();", 100);
function start() {
if (c1 == 59) {
c1 = 00;;
if (c2 == 59) {
c2 = 00;
}
else c2++;
}
else c1++;
if (c1 == 0 || c1 == 1 || c1 == 2 || c1 == 3 || c1 == 4 || c1 == 5 || c1 == 6 || c1 == 7 || c1 == 8 || c1 == 9) o1 = "0" + c1;
else o1 = c1;
if (c2 == 0 || c2 == 1 || c2 == 2 || c2 == 3 || c2 == 4 || c2 == 5 || c2 == 6 || c2 == 7 || c2 == 8 || c2 == 9) o2 = "0" + c2;
else o2 = c2;
if (c3 == 0 || c3 == 1 || c3 == 2 || c3 == 3 || c3 == 4 || c3 == 5 || c3 == 6 || c3 == 7 || c3 == 8 || c3 == 9) o3 = "0" + c3;
else o3 = c3;
document.forms[0].elements[0].value = o3 + ":" + o2 + ":" + o1;
ID = window.setTimeout("start();", 100);
}
</script>
</head>
<body>
<form name="frm1">
<input type="text" name="timer1">
<input type="button" name="but1" value="start" onClick="c1=0; c2=0; c3=0; o1=0; o2=0;
o3=0; start();">
<input type=button name="but2" value="stop" onClick="window.clearTimeout(ID);">
</form>
</body>
</html>
状态栏给出错误:对象不支持此操作。