css
css copied to clipboard
Button accessibility?
I saw that primer is requiring to add type attributes to all <button> tags.
My question is:
Does adding type attributes to <button> tags improve accessibility?
- If so, how does it improve accessibiilty?
- If not, are there any other reasons for using the
typeattribute other than distinguishing between, "button", "submit" and "reset" behaviors?
Tried googling around to answer my question but haven't been able to find any answers.
So far, I could only find documentation regarding usage of role="button" for elements made clickable, like <a> tags.
It's not about accessibility, it's about specific usage. type will default to submit (within forms at least) and that changes behavior. Adding an explicit type will ensure folks don't run into accidental form submissions.
Thanks @mdo