What are Events?
Events are actions or occurrences that happen in the system where we do programming, which the system tells you about so that we can respond to these events in some way if desired. For example, if the user selects a button on a webpage, one might want to respond to that action by displaying a dialog box.
Understanding the basics of Events:
Button 1 is Clicked Button 2 is Clicked Button 3 is Clicked
When button 1 is clicked, we get the output in the console as Button 1 is Clicked and similarly depending on the button which is clicked. Here we have an event handler that is associated with the button which looks for the click event.
Button 1 Button 2 Button 3
If we replace the e.target with just e we would get the event object as the output that can be used to extract any information about the event.
click click click