原生:倒計時(請仔細閱讀許可協議)

<!DOCTYPE html>
<html>
 <head>
  <title>許可協議按鈕</title>
  <meta charset="gb2312" />

  <style type="text/css">
   #an{ width:170px;height:24px; }
  </style>

  <script type="text/javascript">
   var i=10;
   function init(){
    document.forms[0].an.disabled=true;
    yz();
   }

   function yz(){
    document.forms[0].an.value="(" + i +  ") 請仔細閱讀許可協議";
    i--;
    if(i<0){
     document.forms[0].an.disabled=false;
     return false;
    }
    setTimeout("yz()",1000);
   }
  </script>

 </head>

 <body onload="init()">
  <form method="post" action="">
   <input type="button" id="an" name="an" value="單擊"/>
  </form>

 </body>
</html>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章