倒计时登录的小例子

来源:互联网 发布:python3接收post数据 编辑:程序博客网 时间:2024/06/05 08:07
<head>
     <title>No.Javascript倒计时演示</title>
</head>
<!-- 经常看到注册会员时,接受协议所用到的效果 -->
<BODY>
<textarea name="content" readonly>fsdf</textarea>
<input type="button" id="agree" value="请认真查看<服务条款和声明> (10)" onclick="location.href='xxxx.asp'">
</BODY>
</HTML>
<script language=javascript>
    var settime=10;
    var i;
    var showthis;
    document.all.agree.disabled=true;
    for(i=1;i<=settime;i++)     {
       setTimeout("update("+i+")",i*1000);
    }
    function update(num) {
       if(num==settime) {
    document.all.agree.value="我同意";
    document.all.agree.disabled=false;
     }
     else {
     showthis=settime-num;
     document.all.agree.value="请认真查看<服务条款和声明> ("+showthis+")";
     }
    }
</script>
disabled=true//表示按钮为灰色
原创粉丝点击