css icon indicating copy to clipboard operation
css copied to clipboard

Button accessibility?

Open hellobrian opened this issue 11 years ago • 2 comments

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?

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.

hellobrian avatar Jul 27 '15 14:07 hellobrian

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.

mdo avatar Jul 27 '15 16:07 mdo

Thanks @mdo

hellobrian avatar Jul 27 '15 17:07 hellobrian