WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: A simple beginner's question

for

From: Léonie Watson
Date: May 22, 2016 2:21PM


> From: WebAIM-Forum on Behalf Of Alexander Karelas
> Sent: 22 May 2016 20:57
> I'm creating a website without any AJAX, that I want to be accessible.
>
> Should I use the aria-* attributes and rely on them? Or are aria-* attributes
> only for AJAX websites?

If you use HTML elements for their intended purpose, there shouldn't be any need to use ARIA. ARIA is used when HTML isn't able to provide the semantic information you need.

For example if you use the <button> element, the browser knows it is a button. There is no need to use ARIA to tell the browser something it already knows. Putting role="button" on the <button> element is therefore redundant.

But there is no way in HTML to indicate when a button has been pressed. This is a time when ARIA can be used to fill in the gap. You can set aria-pressed="true" on a button to indicate when it has been pressed.

These notes on using ARIA in HTML might be helpful:
http://w3c.github.io/aria-in-html/

Léonie.

--
@LeonieWatson tink.uk Carpe diem