Why does semantic HTML matter beyond screen readers?
Connect native semantics to accessibility APIs, keyboard behavior, browser defaults, and automated tooling.
A button made from a <div> can look exactly like a real button. The difference appears when someone tries to reach it with a keyboard, activate it with the expected keys, or use a screen reader to understand what it does. HTML elements carry behaviour and meaning that a visual imitation does not get for free.
A button made from a <div> can look exactly like a real button. The difference appears when someone tries to reach it with a keyboard, activate it with the expected keys, or use a screen reader to understand what it does. HTML elements carry behaviour and meaning that a visual imitation does not get for free.
The quick version
Semantic elements communicate role, name, state, and relationships to browsers and assistive technologies while providing built-in interaction behavior. They also improve keyboard support, maintainability, and machine interpretation.
Build the mental model
A <button> has activation and focus behavior; a clickable <div> does not. Landmark elements help navigation. Accessible names come from labels and content relationships, not from visual appearance alone.
See it in code
<main>
<h1>Account settings</h1>
<button type="button">Save changes</button>
</main>
Where it gets tricky
A label contributes to a control’s accessible name, while aria-describedby supplies supporting description. Native buttons, links, inputs, and headings expose behavior and relationships that custom elements must otherwise recreate. Inspect the accessibility tree and use a screen reader for important flows; automated checks cannot fully judge whether names and announcements make sense.
A common misunderstanding
ARIA should not be used to recreate native semantics that already exist.
What this changes in an application
Start with semantic HTML, test keyboard-only use, inspect the accessibility tree, and add ARIA only to fill a genuine semantic gap.
Questions worth exploring next
- What is the difference between a label and an accessible name?
- When is
role="button"insufficient?
References and next steps
- HTML: A good basis for accessibility — primary or authoritative documentation for the underlying behavior.
- MDN Web Docs — use the relevant API reference for adjacent browser details.