程序我写出来了,然而返回两个字和其它字不在一条线上,是不是只能用css调呢?
问题:程序我写出来了,然而返回两个字和其它字不在一条线上,是不是只能用css调呢?
问题:程序我写出来了,然而返回两个字和其它字不在一条线上,是不是只能用css调呢?
2016-09-21
<!DOCTYPE html>
<html>
<head>
<title>浏览器对象</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head>
<body>
<!--先编写好网页布局-->
<h1>操作成功</h1>
<p><span id="sn"></span>秒后返回主页<a href="http://www.imooc.com/code/1633">返回</a></p>
<script type="text/javascript">
//获取显示秒数的元素,通过定时器来更改秒数。
var s=setInterval(secondsnum,1000);
var sn=document.getElementById("sn")
sn.innerHTML=5;
function secondsnum(){
if(sn.innerHTML==0){
window.open("http://www.imooc.com/code/1633","_self");
}else{
sn.innerHTML--;
}
}
//通过window的location和history对象来控制网页的跳转。
</script>
</body>
</html>
举报