码迷,mamicode.com
首页 > 其他好文 > 详细

老师授课-3-倒计时之后点击

时间:2016-05-25 20:49:10      阅读:209      评论:0      收藏:0      [点我收藏+]

标签:

 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 2 <html xmlns="http://www.w3.org/1999/xhtml">
 3 <head>
 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 5 <title>无标题文档</title>
 6 <style>
 7 .bb
 8 {
 9     width:100px; height:40px; background-color:#0F3; border:5px double blue;}
10 
11 </style>
12 </head>
13 <body>
14 <input type="button" value="同意(10)" id="bb" disabled="disabled" />
15 </body>
16 </html>
17 <script>
18 var n =10;
19 var bb = document.getElementById("bb");
20 function bian()
21 {
22     n--;
23     if(n==0)
24     {
25         bb.removeAttribute("disabled");
26         bb.value="同意";    
27     }
28     else
29     {
30         bb.value="同意("+n+"";    
31         window.setTimeout("bian()",1000);
32     }    
33 }
34 window.setTimeout("bian()",1000);
35 
36 </script>

运行

技术分享技术分享技术分享技术分享技术分享技术分享技术分享技术分享技术分享技术分享技术分享

老师授课-3-倒计时之后点击

标签:

原文地址:http://www.cnblogs.com/tonyhere/p/5528291.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!