Javascript remove event listener Code Example

Last Updated On Thursday 20th Jan 2022

remove event listener javascript

  • Events added by addEventListener() can only be removed by removeEventListener()
  • This Method does not support the removal of anonymous functions.
	element.addEventListener("click", function _listener() {
  // do something

  element.removeEventListener("click", _listener, true);
}, true);