Skip to main content

Function: on()

function on(
el: unknown,
type: string,
handler: (ev: Event) => void,
runtime?: DomHelpersRuntime
): (() => void) | undefined;

Defined in: utils/dom/domHelpers.ts:86

Attach an event listener when the target is element-like.

Parameters​

el​

unknown

type​

string

handler​

(ev: Event) => void

runtime?​

DomHelpersRuntime = ...

Returns​

(() => void) | undefined

Cleanup callback that removes the listener by aborting its signal.