Going Global: Global Events
Explore how global events work in HTML5 and JavaScript, including user interactions and document lifecycle events. Understand attaching event handlers to elements such as buttons, forms, and media. Learn to identify event attributes and use common events like keyboard, mouse, and media events to create responsive web pages.
You already used a few events in exercises, such as the onload event when you set the onload attribute of the <body> tag, or the onclick event when you set the onclick attribute of a <button> element.
HTML5 defines dozens of events that are triggered either as a result of user interactions, or as a result of state changes in the document’s lifecycle. You can attach event handler scripts to HTML elements. These handlers are fired when the specific event is triggered.
📜NOTE: You can easily distinguish event attributes from other ones, as their ...