WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Link vs Button for "Cancel"

for

From: Tim Harshbarger
Date: Jan 8, 2018 7:45PM


I think the javascript for either having an HTML button move the user to a new page or to make the control activate using space or Enter is trivial. I remember reading a brief article by Karl Groves that actually provides the javascript for setting up a link with role="button" to trigger using spacebar or enter. And the javascript for loading a new URL when the button is clicked is pretty simple.

Personally, I have a feeling that normal people (people who are not technologists like us) do not have such a technical view of links vs. buttons. That is why I tend to use the duck rule. If it looks like a duck, give it a role="duck". Better yet, if you want it to look like a duck, just use a real duck. Stop making flamingos look like ducks and then giving them role="duck". But that is just a personal opinion--and I have colleagues I respect greatly who have very different opinions on the matter.