focus and blur events
Events fired when an element gains keyboard focus (focus) or loses it (blur); they do not bubble.
In more detail
Because they do not bubble, a delegated listener on an ancestor never sees them unless it uses capture. focusin and focusout are the bubbling versions.
Related terms
- focusin and focusout — The bubbling versions of the focus and blur events, which fire as focus moves into or out of an element and travel up to its ancestors.
- keyboard focus — The state of being the one element on the page that receives keyboard input, usually shown with an outline.
- event bubbling — The way an event on an element also triggers handlers on its parent elements, one level at a time up the tree.
Taught in
- Event Delegation: Memory-Efficient Interaction Handlers — Frontend Architecture & Web Platform