element.removeEventListener(event, listener, useCapture)
Parameters: It accepts three parameters which are specified below-
- event: It is a string which describes the name of event that has to be remove.
- listener: It is the function of the event handler to remove.
- useCapture: It is an optional parameter. By default it is Boolean value false which specifies the removal of event handler from the bubbling phase and if it is true than the removeEventListener() method removes the event handler from the capturing phase.
Before hovering over the text-
After hovering 2 times over the text-
After clicking “click here” button-
Note: If the triggered event needs to be found out, the type event property can be used. This property can be used to remove specific event by finding the type of the triggered event.
Before clicking the “click here” button-
After clicking the “click here” button-