File tree 3 files changed +19
-16
lines changed
3 files changed +19
-16
lines changed Original file line number Diff line number Diff line change 1
1
This is ** _ my css study document_ ** with good tricks, new ideas that it is cool!!!
2
2
3
- ## Deep dive into JavaScript event bubbling and caturing.
3
+ ## [ DOM - The Document Object Model ] ( https://github.com/ImTomQ/html-css/tree/develop/document-object-model#document-object-model-dom )
4
4
5
- If an element and it's parent have an event handler for the same event, which element will work first when triggered?
6
-
7
- Let's start with an example:
8
- This handler is assigned to ` <div> ` , but also runs if click any nested tag like ` <em> ` or ` <code> ` :
9
-
10
- ```
11
- <div onclick="alert('The handler!')">
12
- <em>If you click on <code>EM</code>, the handler on <code>DIV</code> runs.</em>
13
- </div>
14
- ```
15
-
16
- ### Reference
17
-
18
- - https://blog.logrocket.com/deep-dive-into-event-bubbling-and-capturing/
5
+ ### [ Event bubbling and capturing] ( https://github.com/ImTomQ/html-css/tree/develop/document-object-model/event-bubbling-caturing#deep-dive-into-javascript-event-bubbling-and-caturing )
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ In JavaScript, we can grab an HTML tag by referencing to `id` name:
71
71
document.getElementById("id name goes here")
72
72
```
73
73
74
- This code tells the computer to get ` p ` element with id of ` para1 ` and print element to the console
74
+ This code tells the computer to get ` <p /> ` element with id of ` para1 ` and print element to the console
75
75
76
76
```
77
77
const paragraph1 = document.getElementById("para1");
Original file line number Diff line number Diff line change
1
+ ## Deep dive into JavaScript event bubbling and caturing.
2
+
3
+ If an element and it's parent have an event handler for the same event, which element will work first when triggered?
4
+
5
+ Let's start with an example:
6
+ This handler is assigned to ` <div> ` , but also runs if click any nested tag like ` <em> ` or ` <code> ` :
7
+
8
+ ```
9
+ <div onclick="alert('The handler!')">
10
+ <em>If you click on <code>EM</code>, the handler on <code>DIV</code> runs.</em>
11
+ </div>
12
+ ```
13
+
14
+ ### Reference
15
+
16
+ - https://blog.logrocket.com/deep-dive-into-event-bubbling-and-capturing/
You can’t perform that action at this time.
0 commit comments