🔰handler options
Last updated
Was this helpful?
Last updated
Was this helpful?
Was this helpful?
JS ⟩ browser ⟩ event ⟩ handler ⟩ register ⟩ options
elem.addEventListener(event, handler, {
once: true, // automatically removed after it triggers.
capture: true, // capturing phase
passive: true, // handler won't call preventDefault()
});
capture
: -> Bubbling and capturing. options
can also be false/true
, that’s the same as {capture: false/true}
.
passive
: -> Browser default actions.