WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Link vs Button for "Cancel"

for

From: JP Jamous
Date: Jan 8, 2018 3:50PM


I agree with all of the folks who responded Renato. I personally prefer a link for its simplicity with the href. Also, a link is used to take the user to another page, whereas a button would need a JS function.

Yet, I had a strong feeling that the Cancel link might be styled as a button. I have witnessed this over and over. If you can push back at the designers, go for it. If not, you can keep it as a link and use role="button". That way, the screen reader would announce it as a button just to keep that harmony between visual and programmatic design.

I don't think the space bar is an issue at this point if you use role="button". You can activate a button using space bar with a screen reader running. For keyboard only users, they would most likely use the Enter key. I would not sweat over this one much.