//注:该代码核心来自JS教程黑马程序员JavaScript中,不善之处,请谅解。嘿嘿。本人小白一枚,欢迎交流。
//写在这里也就当笔记使用了,都懂128G内存的痛 ———__———!
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>TEST</title>
</head>
<body>
<input type="button" value="Cick" onclick="change()" id="d1">
<script>
var getid=document.getElementById("d1");
getid.onclick=function(){
alert("注册成功,5秒后自动跳转页面至首页");
document.write("页面将在"+"<span id='d2'>"+"5"+"</span>"+"秒后跳转"+"<br />");
document.write("如果没有跳转,请点击下面链接手动跳转");
document.write("<a href='http://www.baidu.com'>"+"<br />"+"手动跳转"+"</a>")
setInterval("timeout()",1000);
setTimeout("change()",5000);
}
function change(){
location.replace("http://www.baidu.com");
}
function timeout(){
var interval=document.getElementById("d2");
var arr=interval.innerHTML;
interval.innerHTML=arr-1;
}
</script>
</body>
</html>
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!