Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
试试这个:
<input type="text" id="but1" /> <input type="text" id="but2" /> <input type="text" id="but3" /> <input type="button" value="start" onclick="timer(1)" /> <input type="button" value="start" onclick="timer(2)" /> <input type="button" value="start" onclick="timer(3)" /> <input type="button" value="stop" onclick="stoptimer(1)" /> <input type="button" value="stop" onclick="stoptimer(2)" /> <input type="button" value="stop" onclick="stoptimer(3)" /> <script type="text/javascript"> var counts = []; var xs = []; for (var i = 1; i < 10; i++) { counts.push(i*2); xs.push(0); }; function timer(id) { xs[id]=setTimeout("timer("+id+")",1000); counts[id]=counts[id]-1; document.getElementById("but"+id).value=counts[id]; if (counts[id] <1){counts[id]=5;} } function stoptimer(id) { clearTimeout(xs[id]); } </script>
try this:
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
暂无简介
文章 0 评论 0
接受
发布评论
评论(1)
试试这个:
try this: