求:十五分钟定时器代码
发布网友
发布时间:2022-04-30 00:42
我来回答
共1个回答
热心网友
时间:2022-06-27 10:32
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!--
var time = 15*60;
function a(){
alert("到点");
clearInterval(d);
}
function dis(){
time = time - 1;
document.all.t.innerHTML = time;
}
setTimeout( "a()", 15*60*1000); // 15为分钟
var d = setInterval( "dis()", 1000);
//-->
</SCRIPT>
<BODY>
还有<span id="t"></span>秒
</BODY>
</HTML>