Skip to content

Commit 1f5a40f

Browse files
Update article.md
1 parent b0464bb commit 1f5a40f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

2-ui/2-events/02-bubbling-and-capturing/article.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ When an event happens -- the most nested element where it happens gets labeled a
206206
207207
- Then the event moves down from the document root to `event.target`, calling handlers assigned with `addEventListener(..., true)` on the way (`true` is a shorthand for `{capture: true}`).
208208
- Then handlers are called on the target element itself.
209-
- Then the event bubbles up from `event.target` up to the root, calling handlers assigned using `on<event>` and `addEventListener` without the 3rd argument or with the 3rd argument `false/{capture:false}`.
209+
- Then the event bubbles up from `event.target` to the root, calling handlers assigned using `on<event>` and `addEventListener` without the 3rd argument or with the 3rd argument `false/{capture:false}`.
210210
211211
Each handler can access `event` object properties:
212212
@@ -220,6 +220,6 @@ The capturing phase is used very rarely, usually we handle events on bubbling. A
220220
221221
In real world, when an accident happens, local authorities react first. They know best the area where it happened. Then higher-level authorities if needed.
222222
223-
The same for event handlers. The code that set the handler on a particular element knows maximum details about the element and what it does. A handler on a particular `<td>` may be suited for that exactly `<td>`, it knows everything about it, so it should get the chance first. Then its immediate parent also knows about the context, but a little bit less, and so on till the very top element that handles general concepts and runs the last.
223+
The same for event handlers. The code that set the handler on a particular element knows maximum details about the element and what it does. A handler on a particular `<td>` may be suited for that exactly `<td>`, it knows everything about it, so it should get the chance first. Then its immediate parent also knows about the context, but a little bit less, and so on till the very top element that handles general concepts and runs the last one.
224224
225225
Bubbling and capturing lay the foundation for "event delegation" -- an extremely powerful event handling pattern that we study in the next chapter.

0 commit comments

Comments
 (0)