<!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>
<input type="button" id="agree" value="还剩下(50)分钟">
</BODY>
</HTML>
<script type="text/javascript">
var settime=50;
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>
<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>
<input type="button" id="agree" value="还剩下(50)分钟">
</BODY>
</HTML>
<script type="text/javascript">
var settime=50;
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>