1 <!DOCTYPE html>
 2 <html>
 3 <head>
 4 <title>倒计时跳转</title>
 5 </head>
 6 <body>
 7  
 8     <div id="msg"></div>
 9     <script>
10         var times=10;
11         function test(){
12             document.getElementById("msg").innerHTML="页面将在"+times+"后跳转";
13             times-=1;
14             if(times<=0){
15                 window.clearInterval(doTEST);
16                 window.location.href="http://www.baidu.com";
17             }
18         }
19         var doTEST;
20         window.clearInterval(doTEST);
21         doTest=window.setInterval("test()",1000);
22     </script>
23 
24 </body>
25 </html>

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-25
  • 2022-12-23
  • 2021-12-14
  • 2022-12-23
  • 2021-09-21
猜你喜欢
  • 2022-12-23
  • 2021-10-19
  • 2021-06-28
  • 2022-12-23
  • 2022-12-23
  • 2022-02-24
  • 2022-12-23
相关资源
相似解决方案