• 软件测试技术
  • 软件测试博客
  • 软件测试视频
  • 开源软件测试技术
  • 软件测试论坛
  • 软件测试沙龙
  • 软件测试资料下载
  • 软件测试杂志
  • 软件测试人才招聘
    暂时没有公告

字号: 小 中 大 | 推荐给好友 上一篇 | 下一篇

Javascript倒计时演示

发布: 2007-5-25 23:40 | 作者: 佚名 | 来源: 互连网 | 查看: 62次 | 进入软件测试论坛讨论

领测软件测试网 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML1.0 Transitional //EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml" lang="gb2312">
<meta http-equiv="Content-type" content="text/html;charset=gb2312" />
<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 type="text/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>

延伸阅读

文章来源于领测软件测试网 https://www.ltesting.net/