Update javascript-event-bubbling-capturing-delegation.md
This commit is contained in:
committed by
GitHub
parent
ad5da50a57
commit
bb013f40c2
@ -54,7 +54,7 @@ You can use event capturing by applying a third argument to [`EventTarget.addEve
|
|||||||
```js
|
```js
|
||||||
// Capture phase
|
// Capture phase
|
||||||
ancestors.forEach(a => {
|
ancestors.forEach(a => {
|
||||||
a.addEventListener('click', event => {
|
a.addEventListener('click', e => {
|
||||||
console.log(`Hello from ${e.currentTarget}`);
|
console.log(`Hello from ${e.currentTarget}`);
|
||||||
}, true);
|
}, true);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user