简单定时器
<div id="aa">1</div> <script language="javascript"> var t = 1; function timeF() { if (t >= 5) { window.clearInterval(setIn); alert("时间到!"); } document.getElementById("aa").innerHTML = t + ""; t += 1; } var setIn = setInterval(timeF, 1000); </script>