<html>
<style>
</style>
<script>
var time = 31;//倒计时时间,秒
function timer()
{
if (time > 0)
{
time--;
document.getElementById("dv").innerHTML = time;
setTimeout("timer()", 1000);
}
else
{
window.close();
}
}
window.onload=function()
{
document.getElementById("dv").innerHTML = time;
timer();
}
</script>
<body>
<div id=dv></div>
<form name=f1 id=f1></form>
</body>
</html>
<style>
</style>
<script>
var time = 31;//倒计时时间,秒
function timer()
{
if (time > 0)
{
time--;
document.getElementById("dv").innerHTML = time;
setTimeout("timer()", 1000);
}
else
{
window.close();
}
}
window.onload=function()
{
document.getElementById("dv").innerHTML = time;
timer();
}
</script>
<body>
<div id=dv></div>
<form name=f1 id=f1></form>
</body>
</html>
<SCRIPT LANGUAGE="JavaScript">
<!--
var time = 60;
function foo()
{
time -= 1;
if (time == 0)
{
document.getElementById("tt").value = "OVER";
alert("close");
window.close();
}
else
{
document.getElementById("tt").value = "Time left: " + time;
setTimeout(foo, 1000);
}
}
foo();
//-->
</SCRIPT>like this.
<script>
o = document.getElementById("b");
start = 10;
setInterval("o.value=start--",1000);
</script>
<style>
</style>
<script>
var time = 30;//倒计时时间,秒
function timer()
{
if (time > 0)
{
time--;
document.getElementById("dv").innerHTML = time;
setTimeout("timer()", 1000);
}
else
{
window.close();
}
}
window.onload=function()
{
document.getElementById("dv").innerHTML = time;
}
</script>
<body>
<div id=dv></div>
<form name=f1 id=f1>
<input type=button value="关闭" onclick="setTimeout('timer()', 1000);">
</form>
</body>
</html>
var nduration = 900
function dojishi(){
nduration --;
if(nduration ==0)
{window.opener=null;window.close();}
else
{
document.all.item('dd').value = nduration;
}
}
window.setInterval("dojishi()",1000)
</script>
<body>
你还有<input id='dd' type=text>秒关闭
</body>