HTML ARIA Roles: Native and Explicit Semantics
Implicit roles
Many HTML elements have an implicit role determined by element and context. A button already exposes button semantics; adding role="button" is unnecessary. Some elements do not map to a named landmark in every context.
<nav aria-label="Lessons"> <a href="#start">Start</a></nav><main id="start"> <h1>Start here</h1></main>Inspect navigation and main roles without explicit role attributes.
Explicit roles and behavior
ARIA supplies semantics, not implementation. A role on a generic element does not add focusability, keyboard activation, or native form behavior. This deliberately incomplete comparison shows why native elements are preferred; do not ship the div as a button.
<div role="button">Incomplete action</div><button type="button">Native action</button>The div has button semantics but is not normally in Tab order; the native button is.
Use a supported explicit role
For a dynamic status message, a generic container can take role="status". It communicates a nonurgent update and has implicit polite live behavior. Check allowed roles for the host element; an arbitrary role override may be invalid or erase useful semantics.
Inspect status role; this static text does not demonstrate a live announcement.
Common mistakes and practice
Consult ARIA in HTML for allowed roles. Do not turn links into buttons by changing their role alone. Roles such as tab require a complete interaction pattern; consult the APG before building custom widgets.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
HTML ARIA Roles: Native and Explicit Semantics — Knowledge Check
Apply the accessibility concepts taught in this lesson.
What is an implicit role?
Does role="button" on div add keyboard activation?
What is a good role for a nonurgent dynamic status?
What should you check before overriding a role?
Which is the simplest accessible action control?