Demo entry 6687633

timer1

   

Submitted by wyx on Dec 30, 2017 at 04:10
Language: HTML. Code size: 519 Bytes.

<!DOCTYPE  html>
<html  lang="zh-cn">
<head>
<title>计时器1</title>
  <style> 
     span {text-decoration:underline;}
     span:hover {cursor:pointer}
  </style>
  <script>
     var t = 0.00;
     var start = false;
	 function f() {
		t=t+0.01;
		var ctrl = document.getElementById("timer");
		ctrl.innerHTML = t.toFixed(2);
		window.setTimeout(f, 10);
	}
  </script>
</head>
<body>
  <h1>计时器1</h1>
  <div><span id="start" onclick="f()">启动</span></div>
  <div id="timer" >0.00</div>
</body>
</html>

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).