Blogger Information
Blog 250
fans 3
comment 0
visits 321789
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
JS-文档对象
梁凯达的博客
Original
962 people have browsed it

实例

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	
</head>
<body>
	<button id="btn">测试</button>
</body>
<script>
	//关闭窗口的时候触发  IE支持
	// window.onunload =function(){
	// 	alert('关闭了');
	// }
	// 离开页面的时候给予提示信息
	window.onbeforeunload = function(){
		return '哈哈哈';
	}

	//alert(this);
	//文档加载成功的时候 自动触发
	// window.onload=function(){
	// 	var btn =document.getElementById('btn');
	// 	alert(btn);
	// }
</script>

</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!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post