🔰handler options

JSbrowsereventhandlerregister ⟩ options

elem.addEventListener(event, handler, {
    once: true,    // automatically removed after it triggers.
    capture: true, // capturing phase
    passive: true, // handler won't call preventDefault()
});

If you pass true to the optional 3rd argument to addEventListener(), the handler is registered as a capturing event handler.

elem.addEventListener(event, handler, true);

Last updated