Skip to main content

removeEventListener

function removeEventListener
Jump to headingremoveEventListener<K extends keyof WindowEventMap>(
type: K,
listener: (
this: Window,
) => any
,
options?: boolean | EventListenerOptions,
): void

Remove a previously registered event listener from the global scope

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

Type Parameters Jump to heading

Parameters Jump to heading

Jump to headinglistener: (
this: Window,
) => any
optional
Jump to headingoptions: boolean | EventListenerOptions

Return Type Jump to heading

void
Jump to headingremoveEventListener(
type: string,
options?: boolean | EventListenerOptions,
): void
Back to top