removeEventListener

Remove a previously registered event listener from the global scope

const listener = () => { console.log('hello'); };
addEventListener('load', listener);
removeEventListener('load', listener);
function removeEventListener<K extends keyof WindowEventMap>(
type: K,
listener: (this: Window, ev: WindowEventMap[K]) => any,
options?: boolean | EventListenerOptions,
): void;
function removeEventListener(
type: string,
options?: boolean | EventListenerOptions,
): void;
§
removeEventListener<K extends keyof WindowEventMap>(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | EventListenerOptions): void
[src]

Remove a previously registered event listener from the global scope

const listener = () => { console.log('hello'); };
addEventListener('load', listener);
removeEventListener('load', listener);

§Type Parameters

§
K extends keyof WindowEventMap
[src]

§Parameters

§
type: K
[src]
§
listener: (this: Window, ev: WindowEventMap[K]) => any
[src]
§
options?: boolean | EventListenerOptions optional
[src]

§Return Type

§
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void
[src]

§Parameters

§
type: string
[src]
§
options?: boolean | EventListenerOptions optional
[src]

§Return Type