-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path088addEventListener.html
51 lines (48 loc) · 1.08 KB
/
088addEventListener.html
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<style type="text/css">
body{
background-color:rgb(177, 208,224); font: normal 12px Trebuchet MS; color:#000;
}
.roundedCorners{
width:220px; padding:10px;
background-color:#DDEEF6;
box-shadow: 0px 0px 10px 0px #888888;
border:1px solid #DDEEF6;
border-radius:6px;
margin: auto;
}
.roundedCorners-textbox{
border:1px solid #999; width:160px;
}
.checkbox {
margin-left: 30px;
border:1px solid #999; width:20px;
}
</style>
</head>
<script type="text/javascript" src="js/common.js" ></script>
<script>
onload = function(){
//addEventListener
var btn = document.getElementById("btn");
btn.addEventListener("click", aaa);
function aaa(){
console.log(1);
}
btn.addEventListener("click", function(){
console.log(2);
});
btn.addEventListener("click", function(){
console.log(3);
});
btn.removeEventListener("click", aaa);
}
</script>
<body>
<button id="btn">按钮</button>
</body>
</html>