See also translations.
Copyright © 2021 W3C® (MIT, ERCIM, Keio, Beihang). W3C liability, trademark and permissive document license rules apply.
This specification defines the authoring rules (author conformance requirements) for the use of Accessible Rich Internet Applications (WAI-ARIA) 1.1 and Digital Publishing WAI-ARIA Module 1.0 attributes on [HTML] elements. This specification's primary objective is to define requirements for use with conformance checking tools used by authors (i.e., web developers). These requirements will aid authors in their development of web content, including custom interfaces/widgets, that makes use of ARIA to complement or extend the features of the host language [HTML].
This section describes the status of this document at the time of its publication. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at https://www.w3.org/TR/.
ARIA in HTML is an [HTML] specification module. Any HTML features, conformance requirements, or terms that this specification module makes reference to, but does not explicitly define, are defined in the HTML specification.
This document was published by the Web Applications Working Group as a Recommendation using the Recommendation track.
W3C recommends the wide deployment of this specification as a standard for the Web.
Future updates to this Recommendation may incorporate new features.
A W3C Recommendation is a specification that, after extensive consensus-building, is endorsed by W3C and its Members, and has commitments from Working Group members to royalty-free licensing for implementations.
This document was produced by a group operating under the W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.
This document is governed by the 2 November 2021 W3C Process Document.
This section is non-normative.
This section is non-normative.
The following uses a role=heading
on a button
element. This is not allowed, because the button
element has default characteristics that conflict with the heading role.
<button role="heading">search</button>
This section is non-normative.
The following uses a role=button
on a button
element. This is unnecessary, as "button" is already exposed as the implicit role for the element. In practice this redundancy will likely not have any unforeseen side effects, other than unnecessarily making the markup more verbose, and incorrectly signaling to other authors that this practice is useful.
<!-- Avoid doing this! -->
<button role="button">...</button>
Similarly, the following uses a role=group
on a fieldset
element, and a role=Main
on a main
element. This is unnecessary, because the fieldset
element is implicitly exposed as a role=group
, as is the main
element implicitly exposed as a role=main
. Again, in practice this will likely not have any unforeseen side effects to users of assistive technology, as long as the declaration of the role
value uses ASCII lowercase. Please see § 3.2 Case requirements for ARIA role, state and property attributes for more information.
<!-- Avoid doing this! -->
<fieldset role="group">...</fieldset>
<!-- or this! -->
<main role="Main">...</main>
The following uses a role=list
on an ul
element. This is generally unnecessary, because the ul
element is implicitly exposed as a role=list
. However, some user agents suppress a list's implicit ARIA semantics if list markers are removed. Authors can use role=list
to reinstate the role if necessary, though this practice would generally not be recommended, otherwise.
<!-- Generally avoid doing this! -->
<ul role="list">...</ul>
This section is non-normative.
The following uses a role=button
on a summary
element. This is unnecessary and can result in cross-platform issues. For instance, preventing the element from correctly exposing its state, and forcing the role of button
, when it might otherwise be exposed with a different role.
<details>
<!-- Avoid doing this! -->
<summary role="button">more information</summary>
...
</details>
The following table provides normative per-element document-conformance requirements for the use of ARIA markup in HTML documents and describes the implicit ARIA semantics that apply to HTML elements as defined in HTML AAM.
Each language feature (element) in a cell in the first column implies the ARIA semantics (role, states, and properties) given in the cell in the second column of the same row. The third cell in each row defines the ARIA role values and aria-*
attributes which MAY be used. Where a cell in the third column includes the term Any role
it indicates that any role
value apart from the implicit ARIA semantics role
value, MAY be used. If a cell in the third column includes the term No role
it indicates that authors MUST NOT overwrite the implicit ARIA semantics, or native semantics of the HTML element.
While setting an ARIA role
and/or aria-*
attribute that matches the implicit ARIA semantics is NOT RECOMMENDED, in some situations explicitly setting these attributes can be helpful – for instance, in user agents that don't expose specific implicit ARIA semantics.
While it is conforming to use Digital Publishing WAI-ARIA Module 1.0 role
values as outlined in the following table, the current support for exposing the semantics of these values to users of assistive technology is close to non-existent.
HTML element | Implicit ARIA semantics (explicitly assigning these in markup is NOT RECOMMENDED) | ARIA roles, states and properties which MAY be used |
---|---|---|
a with href | role=link | Roles: DPub Roles: Global It is NOT RECOMMENDED to use Note If a link needs to be "disabled", remove the href attribute. |
a without href | No corresponding role | Global |
abbr | No corresponding role | Global |
address | No corresponding role | Global |
area with href | role=link | No Global |
area without href | No corresponding role | No Global |
article | role=article | Roles: Global |
aside | role=complementary | Roles: DPub Roles: Global |
audio | No corresponding role | Role: Global |
autonomous custom element | Role exposed from author defined ElementInternals . Otherwise no corresponding role. | If role defined by Otherwise, any Global |
b | No corresponding role | Any role Global |
base | No corresponding role | No role or aria-* attributes |
bdi | No corresponding role | Any role Global |
bdo | No corresponding role | Any role Global |
blockquote | No corresponding role | Global |
body | No corresponding role | No Global |
br | No corresponding role | Roles: Global |
button | role=button | Roles: Global |
canvas | No corresponding role | Global |
caption | No corresponding role | No |
cite | No corresponding role | Any role Global |
code | No corresponding role | Any role Global |
col | No corresponding role | No role or aria-* attributes |
colgroup | No corresponding role | No role or aria-* attributes |
data | No corresponding role | Any role Global |
datalist | role=listbox | No Global |
dd | role=definition | No Global |
del | No corresponding role | Global |
dfn | role=term | Any role Global |
details | role=group | No Global |
dialog | role=dialog | Role: Global |
div | No corresponding role | Global |
dl | No corresponding role | Roles: Global |
dt | role=term | Role: Global |
em | No corresponding role | Global |
embed | No corresponding role | Roles: Global |
fieldset | role=group | Roles: Global |
figcaption | No corresponding role | Roles: Global |
figure | role=figure | If the If the Global |
footer | If not a descendant of an article , aside , main , nav or section element, or an element with role=article , complementary , main , navigation or region then role=contentinfo . Otherwise no corresponding role. | Roles: DPub Roles: Global |
form | If the form element has an accessible name: role=form . Otherwise, no corresponding role. | Roles: Global |
form-associated custom element | Role exposed from author defined ElementInternals . Otherwise no corresponding role. | If role defined by Otherwise, form-related roles: Global |
h1 to h6 | role=heading , aria-level = the number in the element's tag name. | Roles: DPub Role: Global |
head | No corresponding role | No role or aria-* attributes |
header | If not a descendant of an article , aside , main , nav or section element, or an element with role=article , complementary , main , navigation or region then role=banner . Otherwise no corresponding role | Roles: Global |
hgroup | No corresponding role | Global |
hr | role=separator | Roles: DPub Role: Global |
html | role=document | No role or aria-* attributes |
i | No corresponding role | Global |
iframe | No corresponding role | Roles: Global |
img with alt ="some text" | role=img | Roles: DPub Role: Global |
img with alt ="" | role=presentation | No role or aria-* attributes except aria-hidden="true" . |
img without an alt attribute | role=img | If no accessible name is provided via other Otherwise, if the |
input type=button | role=button | Roles: Global |
input type=checkbox |
| Roles: Authors SHOULD NOT use the Otherwise, any global Note The HTML |
input type=color | No corresponding role | No |
input type=date | No corresponding role | No Global |
input type=datetime-local | No corresponding role | No Global |
input type=email with no list attribute | role=textbox | No Global |
input type=file | No corresponding role | No |
input type=image | role=button | Roles: Global |
input type=month | No corresponding role | No Global |
input type=number | role=spinbutton | No Global |
input type=password | No corresponding role | No Global |
input type=radio | role=radio | Role: Authors SHOULD NOT use the Otherwise, any global Note The HTML |
input type=range | role=slider | No Authors SHOULD NOT use the Otherwise, any global |
input type=reset | role=button | No Global |
input type=search , with no list attribute | role=searcx | No Global |
input type=submit | role=button | No Global |
input type=tel , with no list attribute | role=textbox | No Global |
input type=text or with a missing or invalid type , with no list attribute | role=textbox | Roles: Global |
input type=text , search , tel , url , email , or with a missing or invalid type , with a list attribute | role=combobox | No Authors SHOULD NOT use the Otherwise, any global |
input type=time | No corresponding role | No Global |
input type=url with no list attribute | role=textbox | No Global |
input type=week | No corresponding role | No Global |
ins | No corresponding role | Global |
kbd | No corresponding role | Global |
label | No corresponding role | No |
legend | No corresponding role | No |
li | role=listitem | Roles: DPub Roles: Global |
link | No corresponding role | No role or aria-* attributes |
main | role=main | No Global |
map | No corresponding role | No role or aria-* attributes |
math | role=math | No Global |
mark | No corresponding role | Global |
menu | role=list | Roles: Global |
meta | No corresponding role | No role or aria-* attributes |
meter | No corresponding role | No Authors SHOULD NOT use the Otherwise, any global |
nav | role=navigation | Roles: DPub Roles: Global |
noscript | No corresponding role | No role or aria-* attributes |
object | No corresponding role | Roles: Global |
ol | role=list | Roles: Global |
optgroup | role=group | No Global |
option element that is in a list of options or that represents a suggestion in a datalist | role=option | No Authors SHOULD NOT use the Global |
output | role=status | Global |
p | No corresponding role | Global |
param | No corresponding role | No role or aria-* attributes |
picture | No corresponding role | No role or aria-* attributes |
pre | No corresponding role | Global |
progress | role=progressbar | No Authors SHOULD NOT use the Otherwise, any global |
q | No corresponding role | Global |
rp | No corresponding role | Global |
rt | No corresponding role | Global |
ruby | No corresponding role | Global |
s | No corresponding role | Global |
samp | No corresponding role | Global |
script | No corresponding role | No role or aria-* attributes |
section | role=region if the section element has an accessible name. Otherwise, no corresponding role. | Roles: DPub Roles: Global |
select (with NO multiple attribute and NO size attribute having value greater than 1 ) | role=combobox | Role: Authors SHOULD NOT use the Otherwise, any global |
select (with a multiple attribute or a size attribute having value greater than 1 ) | role=listbox | No Authors SHOULD NOT use the Otherwise, any global |
slot | No corresponding role | No role or aria-* attributes |
small | No corresponding role | Global |
source | No corresponding role | No role or aria-* attributes |
span | No corresponding role | Global |
strong | No corresponding role | Global |
style | No corresponding role | No role or aria-* attributes |
sub | No corresponding role | Global |
summary | role=button | No Global |
sup | No corresponding role | Global |
SVG | role=graphics-document as defined by SVG AAM | Global |
table | role=table | Global |
tbody | role=rowgroup | Global |
template | No corresponding role | No role or aria-* attributes |
textarea | role=textbox | No Global |
tfoot | role=rowgroup | Global |
thead | role=rowgroup | Global |
time | No corresponding role | Global |
title | No corresponding role | No role or aria-* attributes |
td |
No corresponding role if the ancestor | No Global |
th |
No corresponding role if the ancestor | No Global |
tr | role=row | No Global |
track | No corresponding role | No role or aria-* attributes |
u | No corresponding role | Global |
ul | role=list | Roles: Global |
var | No corresponding role | Global |
video | No corresponding role | Role: Global |
wbr | No corresponding role | Global |
The elements marked with No corresponding role, in the second column of the table do not have any implicit ARIA semantics, but they do have meaning and this meaning may be represented in roles, states and properties not provided by ARIA, and exposed to users of assistive technology via accessibility APIs. It is therefore recommended that authors add a role
attribute to a semantically neutral element such as a div
or span
, rather than overriding the semantics of the listed elements.
Authors are encouraged to make use of the following documents for guidance on using ARIA in HTML beyond that which is provided here:
Unless otherwise stated, authors MAY use aria-*
attributes in place of their HTML equivalents on HTML elements where the aria-*
semantics would be expected. For example, authors MAY specify aria-disabled=true
on a button
element, while also implementing the necessary scripting to functionally disable the button
, rather than the use disabled
attribute.
As stated in WAI-ARIA's Conflicts with Host Language Semantics, when HTML elements use both aria-*
attributes and their host language (HTML) equivalents, user agents MUST ignore the WAI-ARIA attributes – the native HTML attributes with the same implicit ARIA semantics take precedence. For this reason, authors SHOULD NOT specify both the native HTML attribute and the equivalent aria-*
attribute on an element. Please review each attribute for any further author specific requirements.
The following table represents HTML elements and their attributes which have aria-*
attribute parity.
Each language feature (element and attribute) in a cell in the first column implies the ARIA semantics (states, and properties) given in the cell in the second column of the same row. The third cell in each row defines how authors can use the native HTML feature, along with requirements for using the aria-*
attributes that supply the same implicit ARIA semantics.
HTML feature | Implicit ARIA semantics | HTML feature and aria-* attribute author guidance |
---|---|---|
Any element where the checked attribute is allowed | aria-checked="true" | Use the Authors SHOULD NOT use the Authors MAY use the |
Any element where the disabled attribute is allowed, including option disabled and optgroup disabled | aria-disabled="true" | Use the Authors MAY use the Authors SHOULD NOT use Authors MUST NOT use |
Any element where the placeholder attribute is allowed | aria-placeholder="..." | Use the Authors MAY use the Authors MUST NOT use the |
Any element where the max attribute is allowed: meter max , progress max , and input max | aria-valuemax="..." | Use the Authors MAY use the Authors SHOULD NOT use Authors MUST NOT use |
Any element where the min attribute is allowed: meter min and input min | aria-valuemin="..." | Use the Authors MAY use the Authors SHOULD NOT use Authors MUST NOT use |
Any element which allows the readonly attribute: input readonly , textarea readonly and form-associated custom element which allows readonly | aria-readonly="true" | Use the Authors MAY use the Authors SHOULD NOT use the Authors MUST NOT use |
Element with Note This is equivalent to the | aria-readonly="false" | Authors MUST NOT set aria-readonly="true" on an element that has isContentEditable="true" . |
Any element where the required attribute is allowed: input required , textarea required , and select required | aria-required="true" | Use the Authors MAY use the Authors SHOULD NOT use the Authors MUST NOT use |
Any element where the colspan attribute is allowed: td and th | aria-colspan="..." | Use the Authors SHOULD NOT use the Authors MUST NOT use |
Any element where the rowspan attribute is allowed: td and th | aria-rowspan="..." | Use the Authors SHOULD NOT use the Authors MUST NOT use |
Authors SHOULD use ASCII lowercase for all role
token values and any state or property attributes (aria-*
) whose values are defined as tokens.
While modern browsers treat the role
or aria-*
attribute values as ASCII case-insensitive, not all assistive technologies will correctly parse these values.
To reduce interoperability issues, authors are strongly encouraged to use ASCII lowercase for aria-*
and role
attribute values. Further, authors are encouraged to rigorously test with different browser and assistive technology combinations to ensure that their content will be correctly exposed to their users.
This section is non-normative.
The following table maps (and extends) the Kinds of content and allowed descendant information (defined in the [HTML] specification) to elements that have an equivalent role
.
Column 1 links to the normative Accessible Rich Internet Applications (WAI-ARIA) 1.1 definitions for each ARIA role
. Column 2 identifies the Kinds of content categories each role
has when it is used on an HTML element. Column 3 indicates what kinds of HTML elements can be descendants of an element with an explicit role
specified, often matching the HTML element with the same implicit role.
For example, a button
element has an implicit role=button
. In HTML a button
element allows phrasing content as descendants, and does not allow interactive content or descendants with a tabindex
attribute. Therefore, any elements specified with a role=button
would follow the same descendant restrictions, and not allow any interactive content descendants, elements with a tabindex
specified, or any elements with role values that are in the interactive content category (identified in column 3).
<!-- conformance checkers will report an error -->
<button>
<div role="button">...</div>
</button>
<div role="button">
<button>...</button>
</div>
<div role="link">
<textarea>...</textarea>
</div>
Additionally, there are certain roles which Accessible Rich Internet Applications (WAI-ARIA) 1.1 has specified specific requirements for their allowed descendants. These have been identified in column 3 (Descendant allowances) by indicating to "Refer to the 'Required Owned Elements'" for those particular roles.
Role | Kind of content | Descendant allowances |
---|---|---|
alert | Flow content | Flow content but with no main element descendants. |
alertdialog | Flow content | Flow content |
application | Flow content | Flow content |
article | Flow content but with no main element descendants. | |
banner | Flow content but with no main, header, or footer element descendants. | |
button | Phrasing content, but but with no interactive content descendants, and no descendants with a tabindex attribute specified. | |
cell | N/A | Flow content but with no main element descendants. |
checkbox | Phrasing content, but but with no interactive content descendants, and no descendants with a tabindex attribute specified. | |
columnheader | N/A | Flow content but with no main, header, or footer element descendants. |
combobox | Flow content but with no main element descendants. | |
complementary | Flow content but with no main element descendants. | |
contentinfo | Flow content but with no main, header, or footer element descendants. | |
definition | Phrasing content | |
dialog | Flow content | Flow content |
directory | Flow content | Flow content but with no main element descendants. |
document | Flow content | Flow content |
feed | Flow content | Flow content but with no main element descendants. |
figure | Flow content but with no main element descendants. | |
form | Flow content, but with no form element descendants. | |
grid | Refer to the "Required Owned Elements" as defined for the ARIA grid role. | |
gridcell | Interactive content | Flow content but with no main element descendants. |
group | Flow content | |
heading | Flow content but with no main element, heading content, sectioning content, or sectioning roots descendants. | |
img | Phrasing content, but with no interactive content descendants. | |
link | Flow content, but with no interactive content descendants, and no descendants with a tabindex attribute specified. | |
list | Flow content | Refer to the "Required Owned Elements" as defined for the ARIA list role. |
listbox | Refer to the "Required Owned Elements" as defined for the ARIA listbox role. | |
listitem | N/A | Flow content but with no main element descendants. |
log | Flow content | Flow content, but with no main element descendants. |
main | Flow content | Flow content, but with no main element descendants. |
marquee | Flow content | Flow content, but with no main element descendants. |
math | Flow content | Flow content |
menu | Refer to the "Required Owned Elements" as defined for the ARIA menu role. | |
menubar | Refer to the "Required Owned Elements" as defined for the ARIA menubar role. | |
menuitem | Interactive content | Phrasing content, but with no interactive content descendants, and no descendants with a tabindex attribute specified. |
menuitemcheckbox | Interactive content | Phrasing content, but with no interactive content descendants, and no descendants with a tabindex attribute specified. |
menuitemradio | Interactive content | Phrasing content, but with no interactive content descendants, and no descendants with a tabindex attribute specified. |
navigation | Flow content, but with no main element descendants. | |
none | N/A | Transparent |
note | Flow content | Flow content, but with no main element descendants. |
option | Interactive content | Phrasing content, but with no interactive content descendants, and no descendants with a tabindex attribute specified. |
presentation | N/A | Transparent |
progressbar | Phrasing content, but with no progress element descendants. | |
radio | Phrasing content, but with no interactive content descendants, and no descendants with a tabindex attribute specified. | |
radiogroup | Flow content | |
region | Flow content, but with no main element descendants. | |
row | N/A | Refer to the "Required Owned Elements" as defined for the ARIA row role. |
rowgroup | N/A | Refer to the "Required Owned Elements" as defined for the ARIA rowgroup role. |
rowheader | N/A | Flow content but with no main element descendants. |
scrollbar | Interactive content | Phrasing content |
search | Flow content but with no main element descendants. | |
searcx | Flow content but with no main element descendants. | |
separator | Interactive content (if focusable) | Phrasing content |
slider | Phrasing content | |
spinbutton | Flow content but with no main element descendants. | |
status | Flow content | Flow content but with no main element descendants. |
switch | Phrasing content, but with no interactive content descendants, and no descendants with a tabindex attribute specified. | |
tab | Interactive content | Phrasing content, but with no interactive content descendants, and no descendants with a tabindex attribute specified. |
table | Refer to the "Required Owned Elements" as defined for the ARIA table role. | |
tablist | Refer to the "Required Owned Elements" as defined for the ARIA tablist role. | |
tabpanel | Flow content | Flow content |
term | Phrasing content | Phrasing content |
textbox | Interactive content | Flow content but with no main element descendants. |
timer | Flow content | Flow content but with no main element descendants. |
toolbar | Flow content | Flow content but with no main element descendants. |
tooltip | Flow content | Phrasing content |
tree | Flow content | Refer to the "Required Owned Elements" as defined for the ARIA tree role. |
treegrid | Flow content | Refer to the "Required Owned Elements" as defined for the ARIA treegrid role. |
treeitem | Interactive content | Phrasing content |
As well as sections marked as non-normative, all authoring guidelines, diagrams, examples, and notes in this specification are non-normative. Everything else in this specification is normative.
The key words MAY, MUST, MUST NOT, NOT RECOMMENDED, SHOULD, and SHOULD NOT in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.
Conformance checkers that claim support for checking ARIA in HTML documents MUST implement checks for the conformance requirements for use of the ARIA role
and aria-*
attributes on HTML elements as defined in this specification.
A conforming document MUST NOT contain any elements with author defined role
or aria-*
attributes with values other than those which, per this specification, authors MAY use on each HTML element in § 3. Document conformance requirements for use of ARIA attributes in HTML. Conformance checkers SHOULD flag instances where authors are explicitly providing an element with a role
which matches its implicit ARIA semantics as failures, as it is NOT RECOMMENDED for authors to explicitly set these roles.
A conformance checker MAY define their own terminology, and level or levels of severity, when surfacing document failures to conform to this specification.
This section is non-normative.
This specification does not define the features of [wai-aria-1.1], [dpub-aria-1.0] or [HTML]. Rather it provides rules and guidance for conformance checkers that claim support for checking ARIA in HTML, as well as providing guidance to authors.
Therefore, there are no known privacy or security impacts of this specification, as it defines no new features to introduce potential concern.
This section is non-normative.
The following are some significant changes that were made since last wide review:
nav
element. Adds menu
, menubar
and tablist
as allowed rolesaria-*
attributes in HTML. Specifically, clarifies or specifies guidance for use of aria-checked
, aria-disabled
, aria-hidden
, aria-placeholder
, aria-valuemax
, aria-valuemin
, aria-readonly
, aria-required
, aria-colspan
, aria-rowspan
, aria-invalid
svg
aria-disabled
not recommended on a
with href
img
with alt=""
figure
elementimg alt="some text"
role=button
on summary
element. Adding role=button
without also re-implementing aria-expanded
breaks the implicit mapping of the element.br
element. Allows role=presentation
or none
role=doc-epigraph
on section
elementrole=doc-dedication
on aside
elementmenu
and autonomous custom elementrole=note
on section
elementrole=radiogroup
on fieldset
elementhgroup
, a
with and without href
, input type=datetime-local
, slot
, i
, rp
, img
with no alt
and removes elements not part of the HTML Living Standarddata
elementrole=none
and presentation
on iframe
elementrole=combobox
and spinbutton
on input type=text
abbr
elementrole=none
on any element that allows role=presentation
, Add to hr
element. Add to ul
elementa
with href
, aside
, dl
, footer
, h1-h6
, header
, li
, nav
, and section
elementsReferenced in:
Referenced in: