What is an event?
Description :
Responsive websites work on the concept of Events. The browser can keep track of what the user is doing and fires off different events whenever the user decides to do anything. These events can be caught in our Javascript code and we can then react to these events by running the javascript code we want to run. For example, a user could click on a button on the webpage, this would set off a "click" event. We can listen for this "click" event on the button and react to the event by running the code we want.

In javascript, we do this using the addEventListener function. We can set an event listener to any DOM element we want and listen for a multitude of events, which have been detailed later.
Example:
For example, if we have a button with the id (click-me-button) :
<button id="click-me-button"> Click me </button>
We can listen for a click event on this button through the following code :
let button = document.getElementById("click-me-button");
button.addEventListener("click", changeText);
We can then have the code we want to execute in the event of a click inside the changeText() function and whenever the button is clicked, the code inside the changeText() function will be executed.