拷贝以下代码即可,仅仅是模拟这种效果:
index.html代码如下:
<FORM name="agree" action="reg.aspx?action=apply" method="post">
<INPUT type="submit" value= "请认真查看<服务条款和声明>(10秒后继续) " name="agreeb">
</Form>
<SCRIPT language=javascript>
var secs = 10;
document.agree.agreeb.disabled=true;
for(i=1;i <=secs;i++) {
window.setTimeout( "update( " + i + ") ", i * 1000);
}
function update(num) {
if(num == secs) {
document.agree.agreeb.value = "同意并注册 ";
document.agree.agreeb.disabled=false;
}
else {
printnr = secs-num;
document.agree.agreeb.value = "请认真查看<服务条款和声明>( " + printnr + " 秒后继续) ";
}
}
</SCRIPT>