WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Link vs Button for "Cancel"

for

From: Beranek, Nicholas
Date: Jan 8, 2018 2:30PM


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