WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Buttons and links: navigating a mixed list

for

From: glen walker
Date: Aug 24, 2023 11:54AM


I've never understood why anyone would use <a role="button">. I've seen it
sometimes because the designer/developer liked the look/style of a link.
In that case, a real <button> should be used but just style it with CSS to
get the look you want.

Remember that adding aria attributes does not give you any "behavior".
Slapping a role="button" on a link will not make the link work properly
when SPACE is pressed unless you add some javascript. Without handling the
keyboard event, SPACE will just scroll the page instead of selecting the
link/button.

To be consistent, I think links should be used for all the resources. The
link might navigate to a new page or it might download a document. Those
are both acceptable behaviors for a link.

I'm not sure what "launches the resource directly if it is an embedded
HTML-based activity" means. Do you get an embedded iframe within the page?