Accessibility: Accessible names
Visible text usually gives a native button its accessible name. Icon-only controls need an equivalent name.
Current edit
Understand the pattern
Visible text usually gives a native button its accessible name. Icon-only controls need an equivalent name.
Visible text usually gives a native button its accessible name. Icon-only controls need an equivalent name.
Misconceptions to reject
- A visual appearance alone guarantees the intended HTML meaning.
- Replacing semantic elements with generic divs automatically improves accessibility.
The preview is a sanitized subset, not a full browser compatibility test.
Worked example and expected result
<button type="button">Save notes</button><button type="button" aria-label="Close panel">×</button><p>Controls have meaningful names.</p>Visible text usually gives a native button its accessible name. Icon-only controls need an equivalent name.
Explain it
Apply it elsewhere
Keep the momentum.
Complete the lab, then explain and apply the pattern.
Next: Accessibility: Image alternativesTry an incident drillAnonymous lesson and mastery progress lasts for this session. Sign in to keep synced lesson XP between sessions; mastery stays device-local. No speed bonus, lost lives, or hint penalties.
Keep learning
- 01Accessibility: Image alternativesWrite alt text for the image purpose in this context, not every visual detail. Decorative images use alt="".Practice
- 02Accessibility: Landmark labelsDistinct names help people differentiate multiple navigation landmarks.Practice
- 03Accessibility: Keyboard orderNative links and buttons participate in keyboard navigation in source order. Positive tabindex usually creates surprising jumps.Practice