Events

The addEventListener method can be used to add an event listener to a window, document or element in the DOM.


window.addEventListener

window.addEventListener(event, function, useCapture) 

document.addEventListener

document.addEventListener(event, function, useCapture) 

element.addEventListener

Can be used to attach an event handler to an element

element.addEventListener('click', function() {}, false)  

removeEventListener

There is a similar removeEventHandler event for removing an event handler



© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext