<html xmlns="http://www.w3.org/1999/xhtml" lang="gb2312">
<meta http-equiv="Content-type" content="text/html;charset=gb2312" />
<head>
<title>Javascript倒计时演示 </title>
</head>
<BODY>
<input type="label" id="agree" value="(3600)秒">
</BODY>
</HTML>
<script type="text/javascript">
var settime=3600;
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="到时间了,要交卷哦!";
}
else {
showthis=settime-num;
document.all.agree.value="("+showthis+")秒";
}
}
</script>
评论0
最新资源