keyboard focus

The state of being the one element on the page that receives keyboard input, usually shown with an outline.

In more detail

Only one element has focus at a time; document.activeElement tells you which. Keyboard and screen reader users move focus with Tab, Shift+Tab and arrow keys, so every interactive control must be able to receive it and show where it is.

Example

In the browser: Only focusable elements, such as links, buttons and form fields, can take focus by default. Good focus management moves focus into a dialog when it opens and back to the trigger when it closes.

Related terms

Taught in

References