We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3924ebe commit 389ef61Copy full SHA for 389ef61
10 - Events and Event Listeners/index.html
@@ -4,7 +4,7 @@
4
<title>10 - Events and Event Listeners</title>
5
</head>
6
<body>
7
- <button onclick="display();">CLICK ME!</button>
+ <button id="clickButton">CLICK ME!</button>
8
<script src="main.js"></script>
9
</body>
10
</html>
10 - Events and Event Listeners/main.js
@@ -1,3 +1,7 @@
1
function display() {
2
console.log("You clicked the Button!");
3
}
+
+document.getElementById("clickButton").addEventListener("click", display);
+document.getElementById("clickButton").removeEventListener("click", display);
0 commit comments