为了账号安全,请及时绑定邮箱和手机立即绑定

终于跑起来了

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<!DOCTYPE html>
<html>
 <head>
  <title>浏览器对象</title>  
  <meta http-equiv="Content-Type" content="text/html; charset=gkb"/>   
 </head>
 <body>
  <!--先编写好网页布局-->
  <h1>操作成功</h1>
   
 <h3><span id="con">5</span>
 <span>秒后回到主页</span><a href=window.history.back()>返回</a></h3>
  
<script type="text/javascript">  
var num = 5;
function count(){
    num--;
    document.getElementById("con").innerHTML = num;   //获取显示秒数的元素,通过定时器来更改秒数。
    if(num==1){
    window.location.assign("http://www.imooc.com/");
    
}
setInterval(count,1000);
</script> 
</body>
</html>

终于跑起来了

正在回答

代码语言

1 回答

终于跑起来了

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

终于跑起来了

我要回答 关注问题
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号