Skip to content

Commit 509d6d8

Browse files
committed
docs: 📝 wesbos#25 Evens Complete
1 parent e572ed2 commit 509d6d8

File tree

1 file changed

+49
-43
lines changed

1 file changed

+49
-43
lines changed
Lines changed: 49 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,55 @@
11
<!DOCTYPE html>
22
<html lang="en">
3-
<head>
4-
<meta charset="UTF-8">
5-
<title>Understanding JavaScript's Capture</title>
6-
<link rel="icon" href="https://fav.farm/🔥" />
7-
</head>
8-
<body class="bod">
9-
10-
<div class="one">
11-
<div class="two">
12-
<div class="three">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<title>Understanding JavaScript's Capture</title>
6+
<link rel="icon" href="https://fav.farm/🔥" />
7+
</head>
8+
<body class="bod">
9+
<div class="one">
10+
<div class="two">
11+
<div class="three"></div>
1312
</div>
1413
</div>
15-
</div>
1614

17-
<style>
18-
html {
19-
box-sizing: border-box;
20-
}
21-
22-
*, *:before, *:after {
23-
box-sizing: inherit;
24-
}
25-
26-
div {
27-
width: 100%;
28-
padding: 100px;
29-
}
30-
31-
.one {
32-
background: thistle;
33-
}
34-
35-
.two {
36-
background: mistyrose;
37-
}
38-
39-
.three {
40-
background: coral;
41-
}
42-
</style>
43-
44-
<button></button>
45-
<script>
46-
47-
</script>
48-
</body>
15+
<style>
16+
html {
17+
box-sizing: border-box;
18+
}
19+
20+
*,
21+
*:before,
22+
*:after {
23+
box-sizing: inherit;
24+
}
25+
26+
div {
27+
width: 100%;
28+
padding: 100px;
29+
}
30+
31+
.one {
32+
background: thistle;
33+
}
34+
35+
.two {
36+
background: mistyrose;
37+
}
38+
39+
.three {
40+
background: coral;
41+
}
42+
</style>
43+
44+
<button></button>
45+
<script>
46+
const divs = document.querySelectorAll("div");
47+
48+
function logText(e) {
49+
console.log(this.classList.value);
50+
}
51+
document.body.addEventListener("click", logText);
52+
divs.forEach((div) => div.addEventListener("click", logText));
53+
</script>
54+
</body>
4955
</html>

0 commit comments

Comments
 (0)