✔ 最佳答案
==================================================
< head>
< script language= "javascript " type= "text/javascript ">
function CountAndClose()
{
var e = document.getElementById( "counter ");
var cTicks = parseInt(e.innerHTML);
var timer = setInterval(function()
{
if( cTicks )
{
e.innerHTML = --cTicks;
}
else
{
clearInterval(timer);
window.close();
}
}, 1000);
}
< /script>
< /head>
==================================================
< body onload= "CountAndClose() ">
< div id= "counter ">3 </ div>
< /body>