javaScript timer控制
<script type="text/javascript"> var num = 0; //间隔一秒循环执行 var id = setInterval(function () { num = num + 1; document.getElementById("ss").value = num; }, 1000); //间隔一秒执行一次 var ids = setTimeout(function () { num = num + 1; document.getElementById("ss").value = num; }, 1000); //停止方法 function stopModth() { clearInterval(id); clearTimeout(ids); } </script>