拷貝以下代碼即可,僅僅是模拟這種效果:
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>