We can listen for any kind of event using JavaScript, including browser-initiated events, or user-initiated events.
JavaScript in the browser uses an event-driven programming model.
A web page is loaded, and nothing happens until the user does something.
It could be clicking a button, or focusing on an input box and starting typing. Or submitting a form.
When this kind of interactivity happens, you can “hook” in the workflow using JavaScript.
Things start by responding to an event with an event handler.