大牛檢查一下為啥 我的不可以把時(shí)間停止
<!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("clock").value = time;
? ?}
? ? ?var i=setInterval("clock()",1000)
</script>
</head>
<body>
? <form>
? ? <input type="text" id="clock" size="50" ?/>
? ? <input type="button" value="Stop" onclick="clearInterval(i)" />
? </form>
</body>
</html>
2016-08-01
瀏覽器不兼容 ? 換火狐試試?。。?/p>
2016-08-01
我把代碼直接在Chrome里運(yùn)行,沒有問題.我也遇到過,個(gè)人認(rèn)為是慕課網(wǎng)內(nèi)部運(yùn)行會(huì)出現(xiàn)的問題,不放心的話你也可以直接在瀏覽器里運(yùn)行看看
2016-08-01
可以啊