Skip to content

Commit 389ef61

Browse files
committed
Event File changes
1 parent 3924ebe commit 389ef61

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

10 - Events and Event Listeners/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<title>10 - Events and Event Listeners</title>
55
</head>
66
<body>
7-
<button onclick="display();">CLICK ME!</button>
7+
<button id="clickButton">CLICK ME!</button>
88
<script src="main.js"></script>
99
</body>
1010
</html>
+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
function display() {
22
console.log("You clicked the Button!");
33
}
4+
5+
document.getElementById("clickButton").addEventListener("click", display);
6+
7+
document.getElementById("clickButton").removeEventListener("click", display);

0 commit comments

Comments
 (0)