eventlistner in javascript code example
Example 1: eventlistener javascript
document.querySelector("button").addEventListener("click", handle);
function handle() {
alert("I got clicked")
}
Example 2: eventlistener javascript
element .addEventListener( event, function, useCapture );