addEventListenerfullscreenchange
addEventListener is a method available on the EventTarget interface in web browsers, allowing developers to execute code in response to user interactions or other events. It is the standard way to attach event handlers to HTML elements, the document, or window objects. The method takes two primary arguments: the type of event to listen for, specified as a string (e.g., 'click', 'mouseover', 'keydown'), and the function to be executed when the event occurs, known as the event handler or listener.
A third, optional argument, `options`, can be provided to specify certain behaviors. This `options` object can
addEventListener is preferred over older methods like `element.onclick` because it allows multiple listeners to be attached