I was wondering what values are valid in the HTML5/XHTML role attribute?
The role attribute describes the role of an element in programs that can make use of it, such as screen readers or magnifiers. Screen Readers will read this element as “button” instead of “link”.
The attribute describes the role(s) the current element plays in the context of the document. This can be used, for example, by applications and assistive technologies to determine the purpose of an element.
The definition ARIA role indicates the element is a definition of a term or concept. The dialog role is used to mark up an HTML based application dialog or window that separates content or UI from the rest of the web application or page.
Here are the valid roles based on HTML 5.2...
It appears that in HTML5, the contents of the role
attribute is specified as a WIA-ARIA attribute. See, specifically, the last paragraph of section 3.2.3 "Global attributes", where it states:
To enable assistive technology products to expose a more fine-grained interface than is otherwise possible with HTML elements and attributes, a set of annotations for assistive technology products can be specified (the ARIA role and aria-* attributes).
The role
attribute is, then, further detailed in section 3.2.7 "WAI-ARIA", and provides an apparently normative table of semantics and values for the attribute on an element-by-element basis.
Note: The links to specific sections of the HTML5 specification above point to the "latest published version" of the HTML5 Technical Report at http://www.w3.org/TR/html5/. A more current "editor's draft" version might be available. The TR will link to it on the title page of the document. As the specification is updated or transitions to a new phase of adoption, these links might break and will need to be updated.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With