<h3>目標:百度<span id='t'></span></h3> <script> var i=5; var t=document.getElementById('t'); t.innerHTML =i+'秒後跳轉'; setInterval(function () { t.innerHTML=--i+'秒後跳轉'; if(i==0){ location.href='baidu.com' } },1000) </script>