Using ARIA in HTML (Best Practices)
Using ARIA in HTML (Best Practices)
- Use native semantics of HTML (e.g.
input[type=checkbox]
rather than div[role=checkbox]). - Don't override native semantics of elements (e.g.
h2[role="banner]
). - Don't redefine the native semantics of an element (e.g.
main[role=main]
). - All interactive ARIA widgets must be operable with the keyboard.
- Do not use role="presentation" or aria-hidden="true" on a visible focusable elements.
- All interactive elements must have an accessible name.
- Live regions (e.g.
aria-live
attribute andlog
,status
, andalert
roles) should be used with extreme caution, only for asynchronous content changes important for the users attention.