From what I've understood reading about eventListener on MDN the third parameter is options, and across the network, I've seen people doing (event, action) and some do (event, action, false).
What I wonder is in the situation where no option are used is fine to go with the first version or there is some downside in performance?
Asked
Active
Viewed 564 times
1
volna
- 2,452
- 4
- 25
- 61
-
If the third parameter is `false` then use **bubbling**, if it is `true`, then use **capturing**. The terms bubbling and capturing are explained in the duplicate link. – ibrahim mahrir Jun 11 '17 at 18:33
1 Answers
3
element.addEventListener(event, function, useCapture);
The third parameter is a boolean value specifying whether to use event bubbling or event capturing. This parameter is optional.
For more help: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener
user229044
- 232,980
- 40
- 330
- 338
Bhuwan
- 16,525
- 5
- 34
- 57
-
w3schools is a terrible site and you should not link to it to support your answers. – user229044 Jun 13 '17 at 12:55