We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8a5e315 commit 74cd7a6Copy full SHA for 74cd7a6
1 file changed
25 - Event Capture, Propagation, Bubbling and Once/index-START.html
@@ -1,9 +1,11 @@
1
<!DOCTYPE html>
2
<html lang="en">
3
+
4
<head>
5
<meta charset="UTF-8">
6
<title>Understanding JavaScript's Capture</title>
7
</head>
8
9
<body class="bod">
10
11
<div class="one">
@@ -13,7 +15,7 @@
13
15
</div>
14
16
17
-<style>
18
+ <style>
19
html {
20
box-sizing: border-box;
21
}
@@ -39,7 +41,16 @@
39
41
40
42
<button></button>
43
<script>
44
+ const divs = document.querySelectorAll('div');
45
46
+ function logText(e) {
47
+ e.stopPropagation()
48
+ console.log(this.classList.value);
49
+ }
50
51
+ divs.forEach(x => x.addEventListener('click', logText));
52
53
</script>
54
</body>
-</html>
55
56
+</html>
0 commit comments