I'm trying to make a form accessible. Should I make my inputs have both disabled
and aria-disabled
attributes, or just one?
<label for="textbox1">Input</label> <input id="textbox1" type="text" name="Text Box" disabled>
Or like this?
<label for="textbox1">Input</label> <input id="textbox1" type="text" name="Text Box" aria-disabled="true">
Or like this?
<label for="textbox1">Input</label> <input id="textbox1" type="text" name="Text Box" aria-disabled="true" disabled>
ARIA is a set of attributes you can add to HTML elements that define ways to make web content and applications accessible to users with disabilities who use assistive technologies (AT). When accessibility issues cannot be managed with native HTML, ARIA can help bridge those gaps.
Semantic HTML and Accessible Rich Internet Applications (ARIA) help create interfaces that work for everyone in the most performant, robust, and simple way possible. They add essential meaning to your content, which lets web browsers, search engines, screen readers, RSS readers, and ultimately users understand it.
ARIA States & PropertiesWidget attributes. Live region attributes. Drag-and-drop attributes.
The disabled attribute is supported by <button> , <command> , <fieldset> , <keygen> , <optgroup> , <option> , <select> , <textarea> and <input> . This Boolean disabled attribute indicates that the user cannot interact with the control or its descendant controls.
I can take your example, put it in a CodePen, and check it in JAWS and NVDA (sorry, no VoiceOver today):
<label for="textbox1">Input</label> <input id="textbox1" type="text" name="Text Box" disabled>
You will be happy to know that both NVDA and JAWS skip the field (or if explicitly focused, announce that is disabled).
In short, you do not need aria-disabled
any longer. Just use disabled
.
You can read a bit more about the ARIA attributes you can dump in this article by Steve Faulkner (one of the editors of the ARIA spec) from 2015 (though aria-disabled
is not explicitly listed, the concept is the same): http://html5doctor.com/on-html-belts-and-aria-braces/
If my answer looks similar to your other question about required
versus aria-required
, that is because it is essentially the same answer.
An important distinction is that when using voice-over the item with just the 'disabled' property will not be tabbed to. However the item with aria-disabled="true" will still be able to receive focus and report to the screen reader as dimmed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With