Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Capture Option vs useCapture

Tags:

javascript

The docs for addEventListener/removeEventListener both have a capture option and a useCapture parameter.

On its face these seem to do the exact same thing. Could someone elaborate if there are any differences or preferred? Should I use both if I want event listeners added/removed in the capture phase?

like image 672
Newb 4 You BB Avatar asked Oct 21 '25 12:10

Newb 4 You BB


1 Answers

It's exactly the same, here you can find details.

For historical reasons, options can also be false/true, that’s the same as {capture: false/true}.

like image 111
granik96 Avatar answered Oct 24 '25 03:10

granik96



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!