1.setInterval() 方法会不停地调用函数,直到 clearInterval() 被调用或窗口被关闭。
2.由 setInterval() 返回的 id 值可用作 clearInterval() 方法的参数。
var int=.this.setInterval(“fn()”,50)
function fn()
{
var t=new Date()
document.getElementById(“fn”).value=t
}
###button οnclick=“int=window.clearInterval(int)”