ElementInternals: role property
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since October 2023.
The role property of the ElementInternals interface returns the WAI-ARIA role for the element. For example, a checkbox might have role="checkbox". It reflects the role attribute; it does not return the element's implicit ARIA role, if any, unless explicitly set.
Value
A string which contains an ARIA role. A full list of ARIA roles can be found on the ARIA techniques page.
Specifications
| Specification |
|---|
| Accessible Rich Internet Applications (WAI-ARIA)> # dom-ariamixin-role> |