qq_掀起刘海吓死鬼_0
2020-08-13 10:06
<!DOCTYPE html>
<html>
<head>
<title>浏览器对象</title>
<meta http-equiv="Content-Type" content="text/html; charset=gkb"/>
<style>
.czcg,#time{font-weight:bold;}
</style>
<script type="text/javascript">
function count(){
var time = document.getElementById('time');
if(time.innerHTML == 0){
window.location.href="http://www.baidu.com";
}else{
time.innerHTML = time.innerHTML-1;
}
}
window.setInterval("count()",1000);
</script>
</head>
<body>
<!--先编写好网页布局-->
<div class="czcg">操作成功</div><br/>
<div><span id="time">5</span>秒后回到主页 <a href="javascript:" onclick="history.go(-1)">返回</a></div>
</body>
</html>
nhyu
JavaScript进阶篇
468191 学习 · 21891 问题
相似问题