Event Handling

Event handling is the the process of responding to user actions in a web page.

 


<button id="myButton"> Click me </button>


const handleClick = e => {
   console.log('hello')
}

const button = document.getElementById("myButton")

button.addEventListener('click', handleClick )