這一段代碼是怎么實(shí)現(xiàn)點(diǎn)擊button暫停時(shí)間的呀!<head>? ? <title>時(shí)間暫停</title>? ? <script type="text/javascript">? ? ? ? var int = self.setInterval("clock()", 50)? ? ? ? function clock() {? ? ? ? ? ? var t = new Date();? ? ? ? ? ? document.getElementById("clock").value = t;? ? ? ? }? ? </script></head><body>? ? <input type="text" id="clock" size="35" />? ? <button onclick="int=window.clearInterval(int)">? ? ? ? Stop interval</button></body></html>
setInterval 執(zhí)行問題?
給我一杯咖啡
2016-11-19 16:47:50