5.25 日期时间练习

 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 </head>
 7 
 8 <body>
 9 <form>
10 <input type="submit" value="同意(10)" id="1" disabled="disabled"/>
11 </form>
12 </body>
13 </html>
14 <script>
15 var n=10;
16 var a=document.getElementById("1");
17 function hanshu()
18 {
19 n--;
20 if(n==0)
21 {
22 a.value="同意";
23 a.removeAttribute("disabled");    
24 }
25 else
26 {
27 a.value="同意("+n+")";
28 window.setTimeout("hanshu()",1000);    
29 }    
30 }
31 window.setTimeout("hanshu()",1000);
32 </script>

 

posted @ 2016-05-27 23:00  一人饮酒醉(SeVen❤)  阅读(129)  评论(0编辑  收藏  举报