Five simple rules for using ARIA attributes, straight from W3C.
W3C's Using ARIA document has a Notes on ARIA Use in HTML section.
It's a short section, and here's an even shorter summary:
If you can use a native HTML element or attribute [...] instead of [...] an ARIA role, state or property [...], then do so.
Do not change native semantics, unless you really have to.
For example: Developer wants to build a heading that's a tab.
Do not do this:
<h2 role="tab">heading tab</h2>
Do this:
<div role="tab"><h2>heading tab</h2></div>
All interactive ARIA controls must be usable with the keyboard.
Do not use
role="presentation"
oraria-hidden="true"
on a focusable element.Using either of these on a focusable element will result in some users focusing on 'nothing'.
All interactive elements must have an accessible name.
Inspired by Bramus's summary of the five rules.