标签:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>30秒</title>
</head>
<body>
<div style="width:280px;margin:40px auto 0 auto;">
<form action="#" method="post" name="agree">
<input type="button" value="请认真查看<服务条款和声明> (5)" name="agreeb" id="agreeb">
</form>
</div>
<SCRIPT language=javascript>
<!--
// var secs = 5;
// 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 +")";
// }
// }
var secs = 5;
document.getElementById(‘agreeb‘).disabled=true;
for(i=1;i<=secs;i++) {
window.setTimeout("update(" + i + ")", i * 1000);
}
function update(num) {
if(num == secs) {
document.getElementById(‘agreeb‘).value =" 我 同 意 ";
document.getElementById(‘agreeb‘).disabled=false;
}
else {
printnr = secs-num;
document.getElementById(‘agreeb‘).value = "请认真查看<服务条款和声明> (" + printnr +")";
}
}
//-->
</SCRIPT>
</body>
</html>
标签:
原文地址:http://www.cnblogs.com/roves/p/4877833.html