<script language="JavaScript">
var da = 120;//倒计时时间(秒)
function sj()
{
var min, sec, str;
min = Math.floor(da/60);
sec = Math.floor(da%60);
if(isNaN(min))
return "0:00";
str = min.toString()+":";
if(sec>9)
str += sec.toString();
else
str += "0"+sec.toString();
dao.innerText = str;
if(da<=0)
{
clearInterval(st);
alert("时间到,表单自动提交!");
document.formname.submit();
}
da--;
}
sj();
var st = setInterval("sj()",1000);
</script>
----------------------------------------
|