Frontend Modules


Frontend Modules / js/utils/wrapped-events / on

Function: on()

on(el, event, handler): void

Defined in: js/utils/wrapped-events.ts:19

Wrapper around Element.addEventListener that keeps track of the handlers so you can use the off function

Parameters

el

Element

the element that should rect on event

event

keyof HTMLElementEventMap | "action-confirmed"

the event name

handler

(event) => void

the listener to attach

Returns

void