ai code academy · Explore coding
What are JavaScript events?
Events are notifications that something has happened, such as a button being activated, a field changing, or a resource finishing loading. JavaScript event handlers can run a response to those notifications.
Discover ai code academyYour next step: guided practice and AI support in the app.
Download on the App Store ↗An action and its response
A person may activate a save button using a mouse, a touch screen, or a keyboard. The event connects that interaction to a response in the page. Receiving the event and successfully saving the information are separate parts of the feature.
An action and its consequence are separate
An event signals that something happened, such as a click, a submitted form, or a changed field. The event handler describes the program's response. The same physical action may have several consequences because it occurs within a larger document structure.
A person can also reach the same action in different ways, including a mouse and a keyboard. Understanding the action's meaning matters beyond the particular gesture. A working interface connects the intended operation to the controls people actually use.
Follow your interest in interactive features
Events link everyday actions to program behaviour. Discover ai code academy for your next coding step and explore the current app on the App Store.