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 3b2bc9a commit 248a866Copy full SHA for 248a866
25 - Event Capture, Propagation, Bubbling and Once/index-START.html
@@ -37,8 +37,18 @@
37
}
38
</style>
39
40
-<button></button>
41
<script>
+ const divs = document.querySelectorAll('div');
42
+
43
+ function logText (e) {
44
+ console.log(this.classList.value);
45
+ // e.stopPropagation();
46
+ }
47
48
+ divs.forEach(div => div.addEventListener('click', logText, {
49
+ capture: false, // false = capture going up; true = caupture going down
50
+ once: true // listen once, then remove Event Listener
51
+ }));
52
53
</script>
54
</body>
0 commit comments