Beyond_Dream_
2017-12-27 14:18
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<script type="text/javascript">
var num=5;
function five(){
if(num==0){
window.open('http://www.imooc.com');
}
else{
document.getElementById("button").value=num;
num=num-1;
setTimeout("five()",1000);
}}
</script>
</head>
<body>
<input id="button" type="button" onclick="five()" value="倒数五秒进入幕客网" style="color:#C00;width:1000px;background:#0F0">
</body>
</html>
我这边是浏览器阻止了网页打开新窗口,在提示的地方选择始终允许就行了
JavaScript进阶篇
468195 学习 · 21891 问题
相似问题