<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title></title> </head> <body> <div class="block"> <span>提交成功<span id="code">3</span>秒后跳转到指定页面</span> </div> </body> <script type="text/javascript"> function count(){ obj=document.getElementById('code'); s=3; setInterval(function(){ obj.innerHTML=s--; if(s==0){ window.location.href='http://www.baidu.com'; } },1000); } count(); </script> </html>