click event
The event fired when a user activates an element, by a mouse click, a tap or pressing Enter or Space on a button.
In more detail
It fires after the pointer is pressed and released on the same element. Because keyboard activation also fires click on buttons, handling click on a real button covers mouse, touch and keyboard users.
Related terms
- DOM event — An object the browser sends to your code when something happens, such as a click, a key press or a finished download.
- event delegation — Handling events for many child elements with one listener on a shared ancestor, using event.target to find which child was involved.
- keyboard accessibility — Making every feature usable with a keyboard alone, with a visible focus indicator and a sensible order.
Taught in
- Event Phases: Capturing, Target And Bubbling Demystified — Frontend Architecture & Web Platform
- Event Delegation: Memory-Efficient Interaction Handlers — Frontend Architecture & Web Platform