This content originally appeared on Stefan Judis Web Development and was authored by Stefan Judis
I'll definitely reference the following blog post in the future. Kitty Giraudel describes when to use disabled and aria-disabled.
Ready? Because here comes some solid HTML attribute advice.
The disabled attribute is totally fine and should be used when relevant! What’s important is not to use it when the element’s interactivity is necessary to proceed, or when the lack of discoverability is problematic. In these cases, the aria-disabled attribute is better to still convey the same semantics, without impairing on usability.
Generally, Kitty shares the following guidelines on when to use which attribute:
- Use
readonlyon elements which's values still matter to the user and should be sent to the server. - Use
disabledon elements which's values became irrelevant for some reason. - Use
aria-disabledon elements which's interactivity is essential to succeed, because they'll stay focusable and can still trigger validations.
Great great guidelines!
Reply to Stefan
This content originally appeared on Stefan Judis Web Development and was authored by Stefan Judis
Stefan Judis | Sciencx (2024-03-29T23:00:00+00:00) disabled vs aria-disabled on form elements (#note). Retrieved from https://www.scien.cx/2024/03/29/disabled-vs-aria-disabled-on-form-elements-note/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.