為啥我的時(shí)間停不下來(lái)
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>計(jì)時(shí)器</title>
<script type="text/javascript">
? ?function clock(){
? ? ? var time=new Date(); ? ? ? ? ? ? ? ? ? ??
? ? ? document.getElementById("clock1").value = time;
? ?}
? ?var i=setInterval("clock",100);?
??
</script>
</head>
<body>
? <form>
? ? <input type="text" id="clock1" size="50" ?/>
? ? <input type="button" value="Stop" ?onclick="clearInterval(i)"/>
? </form>
</body>
</html>
2017-08-08
瀏覽器的問(wèn)題,把代碼復(fù)制到其他編輯器試試
2017-10-09
保存刷新網(wǎng)頁(yè)就可以了
2017-08-02
var聲明的位置不對(duì)