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

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
role
Chrome – Full support
Chrome 103 (Release date: 2022-06-21)
footnote Full support
Edge – Full support
Edge 103 (Release date: 2022-06-23)
footnote Full support
Firefox – Full support
Firefox 119 (Release date: 2023-10-24)
footnote Full support
Opera – Full support
Opera 89 (Release date: 2022-07-07)
footnote Full support
Safari – Full support
Safari 16.4 (Release date: 2023-03-27)
footnote Full support
Chrome Android – Full support
Chrome Android 103 (Release date: 2022-06-21)
footnote Full support
Firefox for Android – Full support
Firefox for Android 119 (Release date: 2023-10-24)
footnote Full support
Opera Android – Full support
Opera Android 71 (Release date: 2022-09-16)
footnote Full support
Safari on iOS – Full support
Safari on iOS 16.4 (Release date: 2023-03-27)
footnote Full support
Samsung Internet – Full support
Samsung Internet 20 (Release date: 2023-02-10)
footnote Full support
WebView Android – Full support
WebView Android 103 (Release date: 2022-06-21)
footnote Full support
WebView on iOS – Full support
WebView on iOS 16.4 (Release date: 2023-03-27)
footnote Full support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support