-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpractice.html
More file actions
35 lines (35 loc) · 1.02 KB
/
practice.html
File metadata and controls
35 lines (35 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>页面元素的水平居中</title>
<script>
window.onload=function(){
var outer = document.getElementsByTagName("div")[0];
var inner = document.getElementsByTagName("a")[0];
outer.onclick = function(){
alert('outer');
}
inner.onclick = function(event){
alert('inner');
// return false;
event.preventDefault();
// event.stopPropagation();
}
}
</script>
<script>
if(window.ActiveXObject){
var xmlHttpReq = window.ActiveXObject;
}else if(window.XMLHttpRequest){
var xmlhttpReq = new XMLHttpRequest();
}
xmlHttpReq.open("GET","")
</script>
</head>
<body>
<div >
<a href="http://www.baidu.com" >百度</a>
</div>
</body>
</html>