We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6859160 commit caa16b9Copy full SHA for caa16b9
17.addEventListener.js
@@ -0,0 +1,12 @@
1
+// select element
2
+// addEventListener
3
+// what event,
4
+// and what to do (callback function/annonymous funciton/function reference)
5
+
6
+const btn = document.querySelector('.btn');
7
+const h3 = document.querySelector('h3');
8
9
+btn.addEventListener('click', function () {
10
+ // if click btn h3 will add class blue
11
+ h3.classList.add('blue');
12
+});
0 commit comments