ElementInternals: role property
Baseline 2023
Newly available
Since October 2023, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
The role
read-only 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.
Examples
Specifications
Specification |
---|
Accessible Rich Internet Applications (WAI-ARIA) # dom-ariamixin-role |
Browser compatibility
BCD tables only load in the browser