<!DOCTYPE ?HTML><html ><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>系好安全帶,準(zhǔn)備啟航</title><script type="text/javascript">function clock(){ var time=new Date(); document.getElementById("count").value=time;}var i=setInterval("clock()",100)function mm(){ setInterval("clock()",100)}</script></head><body><form><input type="text" id="count"><input type="button" value="stop" onclick="clearInterval(i)"><input type="button" value="start" onclick="mm()"></form></body></html>如果我把函數(shù)"mm()"刪掉,用下面的方法為什么不行】、難道就必須要定義一個(gè)函數(shù)嗎<input type="button" value="start" onclick="setInterval("clock()",100)">
JS的計(jì)時(shí)器問題
沐沐幕
2018-02-02 10:15:55