Your daily frequent11y newsletter, brought to you by @ChrisBAshton:
18 WAI-ARIA attributes that every web developer should know
- Use
aria-label
when you can’t use generic<label>
, andaria-describedby
for supplementary info, such as to associate error messages with their corresponding inputs. Userole="heading"
andaria-level="2"
instead of<h2>
if you can’t use the element (for SEO reasons, etc). Whenever there is a visible status message on the page, it must be announced to users, e.g. withrole="status"
orrole="alert"
. Userole="search"
for landmarking a region responsible for search – there is no HTML5 element for it. - Aside: this article links to the incredibly useful aria practices document, which shows recommended implementations for common components like breadcrumbs and carousels.
Prefer longer newsletters? You can subscribe to week11y, fortnight11y or even month11y updates! Every newsletter gets the same content; it is your choice to have short, regular emails or longer, less frequent ones. Curated with ♥ by developer @ChrisBAshton.