Remove a "mousemove" event handler:
window.removeEventListener("mousemove", myFunction);
The removeEventListener()
method removes an event handler from a window.
The removeEventListener() Method
The removeEventListener() Method
window.removeEventListener(
event,
function,
capture)
Parameter | Description |
event | Required. The name of the event to remove. Do not use the "on" prefix. use "click" instead of "onclick". All HTML DOM events are listed in the: HTML DOM Event Object Reference. |
function | Required. The function to remove. |
capture | Optional (default = false).true - Remove the handler from capturing.false - Remove the handler from bubbling.If the event handler was attached two times, one with capturing and one with bubbling, each must be removed separately. |
NONE |
removeEventListener()
is supported in all browsers:
Chrome | Edge | Firefox | Safari | Opera | IE |
Yes | Yes | Yes | Yes | Yes | Yes |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!