Last updated 2 years ago
Was this helpful?
⟩ ⟩ ⟩ ⟩ ⟩ options
elem.addEventListener(event, handler, { once: true, // automatically removed after it triggers. capture: true, // capturing phase passive: true, // handler won't call preventDefault() });
capture: -> . options can also be false/true, that’s the same as {capture: false/true}.
capture
options
false/true
{capture: false/true}
passive: -> .
passive
If you pass true to the optional 3rd argument to , the handler is registered as a .
elem.addEventListener(event, handler, true);
javascript.info ⟩