Java Script Video Tutorial Archive

addeventlistener and removeeventlistener in JavaScript

❮ Element Object Example Remove a “mousemove” event that has been attached with the addEventListener() method: // Attach an event handler to <div> document.getElementById(“myDIV”).addEventListener(“mousemove”, myFunction);// Remove the event handler from <div> document.getElementById(“myDIV”).removeEventListener(“mousemove”, myFunction); Definition and Usage The removeEventListener() method removes …