WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Link vs Button for "Cancel"

for

From: Mr K M I Brown
Date: Jan 8, 2018 2:39PM


It's hard to tell without the design, but because the link goes somewhere a link is more appropriate.

If you can't change or influence the design, can you influence the text? Cancel feels like an action rather than a destination, could you make it clear to the user they'll go somewhere specific?

On 8 January 2018, at 21:35, Renato Iwashima < <EMAIL REMOVED> > wrote:

> This does beg the question: Why not just use a <button>? If you decide to
go the button route for your "Cancel" action, then I suggest an HTML
<button>.

Primarily because it behaves like a link, it has its own URL and just
navigate the user away to a different page. If I make it a button, I'd need
to implement javascript to navigate the user to a different page which
seems unnecessary.

This is probably an issue with the visual design (it shouldn't look like a
button). But at this point it isn't a change I can make or push back. So I
was wondering if just going with a link would be sufficient enough, without
role="button".

On Mon, Jan 8, 2018 at 1:30 PM, Beranek, Nicholas via WebAIM-Forum <
<EMAIL REMOVED> > wrote:

> Yes, you will need to add keypress event handlers for Enter key and Space
> bar to activate the element with role="button". Also, if the element is not
> natively keyboard-focusable, then you'll need to add tabindex="0".
>
> This does beg the question: Why not just use a <button>? If you decide to
> go the button route for your "Cancel" action, then I suggest an HTML
> <button>.
>
> Nick Beranek
> Capital One
>
>