Semantic role

A semantic role indicates the intended purpose of a user interface element. Indicating the purpose of a user interface element allows tools, such as assistive technologies, to present and support interaction with the element in a manner that is consistent with user expectations.

Semantic roles can either be implicit based on host language semantics, such as the type of an HTML element, or explicit through use of the role attribute.

In HTML, the role attribute is specified as a list of space-separated tokens with each token corresponding to the name of a non-abstract role. The semantic role of an HTML element is the first valid role in this list; if none of the roles are valid, the implicit role of the HTML element is used if one exists. More information on the HTML language semantics can be found in ARIA in HTML.

While ARIA in HTML specifies that authors must use lowercase letters for the value of the role attribute in HTML, most web browsers treat the role attribute as case-insensitive. Do however be aware that some web browsers will treat it as case-sensitive and inconsistencies between web browsers can therefore arise.