HTML DOM Document removeEventListener() Method
- Previous page referrer
- Next page renameNode()
- Go back to the previous level HTML DOM Documents
Definition and usage
removeEventListener()
The method removes event handlers from the document.
Example
Remove the "mousemove" event handler:
document.removeEventListener("mousemove", myFunction);
Syntax
document.removeEventListener(event, function, capture)
Parameters
Parameters | Description |
---|---|
event |
Required. The name of the event to be removed. Do not use the "on" prefix. Use "click" instead of "onclick". All HTML DOM events are listed at:HTML DOM Event Object Reference |
function | Required. The function to be removed. |
capture |
Optional (default = false).
If an event handler is added twice, once for capture and once for bubble, each must be removed separately. |
Return value
None.
Browser support
document.removeEventListener()
It is a DOM Level 2 (2001) feature.
All browsers support it:
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Chrome | IE | Edge | Firefox | Safari | Opera |
Support | 9-11 | Support | Support | Support | Support |
Related pages
Element methods
Document methods
Tutorial
- Previous page referrer
- Next page renameNode()
- Go back to the previous level HTML DOM Documents