EventTarget.removeEventListener() removes an event listener previously registered with addEventListener()(MDN). Match the same type, listener reference, and capture flag.
Pass the required arguments shown below. Check return values and browser support before you rely on the result.
Syntax
Call target.removeEventListener. Start with this line.
Name the function. Store the listener so you can pass the same reference later.
Add.addEventListener("hello", onHello) registers it.
Remove.removeEventListener("hello", onHello) matches and detaches it.
Dispatch. The event fires, but no handler remains.
Example 2 — Function Identity Trap
A new anonymous function does not remove the original listener.
JavaScript
const target = new EventTarget();
target.addEventListener("tick", function () {
console.log("still here");
});
// Different function object — removal fails
target.removeEventListener("tick", function () {
console.log("still here");
});
target.dispatchEvent(new Event("tick"));
// still here
Pass { signal }. The listener is tied to that signal.
Abort later.controller.abort() removes the listener.
Bulk cleanup. One abort can drop every listener that shares the signal.
Compatibility
Browser Support
EventTarget.removeEventListener() is marked Baseline Widely available on MDN (since July 2015). Available in Web Workers. AbortSignal-based cleanup needs modern AbortController support.
✓ Baseline · Widely available
removeEventListener()
Unregister listeners across modern browsers. Match type, function reference, and capture flag.
98%Browser support
Google ChromeSupported · Desktop & Mobile
Full support
Mozilla FirefoxSupported · Desktop & Mobile
Full support
Apple SafariSupported · macOS & iOS
Full support
Microsoft EdgeSupported · Chromium
Full support
Internet ExplorerNo native support · Use a polyfill
Polyfill
OperaSupported · Modern versions
Full support
Samsung InternetSupported · Android
Full support
Android WebViewSupported · Modern WebView
Full support
removeEventListenerExcellent
Bottom line: Safe for everyday use. Prefer named functions or AbortSignal so cleanup always works.
Frequently Asked Questions
EventTarget.removeEventListener(type, listener) removes a handler previously registered with addEventListener. You must pass the same type and the same function (or handleEvent object) reference.
No. MDN marks removeEventListener() as Baseline Widely available (since July 2015). It is not Deprecated, Experimental, or Non-standard. It is available in Web Workers.
Calling it with arguments that do not match any registered listener has no effect. Common causes: a different function reference (anonymous arrows), or a capture flag that does not match.
For matching, only the capture / useCapture flag must match. Other options like passive or once do not matter for removal — but using the same values you used when adding is still the safest habit.
No. If you registered the same function twice — once with capture true and once without — you must remove each separately.
Yes. Pass { signal } from an AbortController to addEventListener, then call abort() on the controller. That removes the listener without calling removeEventListener yourself.