Skip to content

isBound

isBound(element, type, handler): boolean

Defined in: core/dom/events.ts:81

Returns true if a listener added with evt is still bound.

Pass the listener function itself: that works everywhere. Passing its name as a string is only kept for old callers, and relies on Function.name, which IE10 does not have, so there it never matches.

EventTarget

The element the listener was added to.

string

Event type, e.g. keydown.

string | EventListener

The listener function, or its name.

boolean

if (!isBound(document, 'keydown', onKeydown)) {
evt(document, 'keydown', onKeydown);
}