<body>
<div id="time"></div>
<a href="#" onclick="stop()">停止</a>
<script type="text/javascript">
var i=3;
function changeTime(){
document.getElementById("time").innerHTML=i;
i--;
}
changeTime();
var inId=window.setInterval("changeTime()",1000);
function stop(){
window.clearInterval(inId);
}
function autoRedirect(){
window.location="j.html";
}
window.setInterval("autoRedirect()",3000);
</script>
</body>