关于web中注册倒数的问题(亲测)

    <title></title>
    <script type="text/javascript">
        var leftSecond = 10;
        var intervalid;
        function CountDown()
        {
            var btnReg = document.getElementById("btnReg");
            if (btnReg)
            {
                if (leftSecond <= 0)
                {
                    btnReg.value = "同意";
                    btnReg.disabled = false;
                    clearInterval(intervalid);
                }
          
            else {
              
                    btnReg.value = "还剩下" + leftSecond + "秒";
                leftSecond--;
            }
           
            }
           
        }
        intervalid = setInterval("CountDown()", 1000);
    </script>
</head>
<body>
    <input type="button" id="btnReg" disabled="disabled" value="同意"/>
</body>
</html>

posted on 2013-10-13 00:00  夜雨梧桐  阅读(334)  评论(2编辑  收藏  举报

导航