<script type="text/javascript">var id;function start(){ if(id){ //此处用来判断定时器是否存在,该如何理解? return; } id = setInterval(function(){ var time = new Date(); var p = document.getElementById("clock"); p.innerHTML =time.toLocaleTimeString(); }, 1000);}function stop(){ clearInterval(id); id=null;}</script>
添加回答
举报
0/150
提交
取消