MMJiao
2016-12-02 19:31
<!doctype html> <html> <head> <meta charset="utf-8"> <title>制作一个跳转提示页面</title> </head> <body> <p>操作成功</p> <p><span id="txt">5</span>秒后回到主页 <a href="javascript:GoBack()">返回</a></p> <script type="text/javascript"> var num=5; function clock(){ if(num>1){ num=num-1; document.getElementById("txt").innerHTML=num; setTimeout(clock,1000); } else{ location.href("http://www.imooc.com/"); } } setTimeout(clock,1000); function GoBack(){ window.history.back(); } </script> </body> </html>
JavaScript进阶篇
468061 学习 · 21891 问题
相似问题