AddEventListener – Javascript
An event listener is a procedure in JavaScript that waits for an event to occur. The simple example of an event is a user clicking the mouse or pressing a key on the keyboard. The addEventListener() is an inbuilt JavaScript function which takes the event to listen for, and a second argument to be called whenever the described event gets done. Any number of event handlers can be added to a single element without overwriting existing event handlers. Doing different…