We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 82c4871 commit 4c83c09Copy full SHA for 4c83c09
25 - Event Capture, Propagation, Bubbling and Once/index-START.html
@@ -39,7 +39,17 @@
39
40
<button></button>
41
<script>
42
+ const divs = document.querySelectorAll('div');
43
44
+ function logText(e) {
45
+ console.log(this.classList.value);
46
+ e.stopPropogation(); // stop bubbling!
47
+ }
48
+
49
+ divs.forEach(div => div.addEventListener('click', logText, {
50
+ capture: true,
51
+ once: true
52
+ }));
53
</script>
54
</body>
55
</html>
0 commit comments