ARIA role

The role attribute that tells assistive technology what kind of thing an element is, such as button, dialog, tab or switch.

In more detail

Native elements have implicit roles, so <button> is already role button. Custom widgets set role explicitly and must then provide the keyboard behaviour that role promises. Roles, together with states and properties, are the three kinds of ARIA information.

Examples

In the browser: Roles set expectations: a user who hears button expects Enter and Space to work. Only add a role when no native element does the job.
<div role="tablist"><button role="tab" aria-selected={true}>A</button></div>

Related terms

Taught in

References