0

WCAG indicates roughly: buttons are for starting actions, links are for navigation.

What to do when I want to start an action, the app first navigates to a page where the user configures action settings and then start the real action?

The intention and context is: it is a very important action.

Just putting a link "Start action" (with a better name) by a simple link does not give a link sufficient importance. The 'start action' should look like a button to show that something important can be done.

Is it OK to use a <a class="btn btn-success" ... >?

More black-and-white answer: Will using an '<a class="btn btn-success">Call to Action</a>' pass the level AA tests?

So, I am NOT looking for an opinion-based answer. I hope you can give good advice so I can help people.

Of course aria attributes are added to make this 'start' very clear.

tm1701
  • 7,307
  • 17
  • 79
  • 168
  • Sounds like you want advice from someone who's an expert in [ux.se]? I'd check their [help center](https://ux.stackexchange.com/help) before asking though... – Heretic Monkey Oct 20 '21 at 14:56
  • While *compliance* with WCAG spec is an objective on-topic subject here, asking which one is "better" or "feels good" here is going to be a matter of opinion, e.g. a subjective thing. – TylerH Oct 20 '21 at 15:31

1 Answers1

1

A simple way to think about it is, after clicking on the element (or selecting with a keyboard), does it make sense for the user to be able to hit the "back" button on the browser to go back to where they were before starting the action?

For example, an "add to cart" button would probably not be a link because it doesn't make sense to "go back" after adding to the cart. Or rather, I would not expect my item to be removed from the cart by hitting the "back" button.

However, "add to cart" could be a link if it adds to the cart and takes you to the shopping cart view. In that case, the browser "back" button would take me back to the item description but would not remove the item from my cart.

Note that WCAG does not say anything about whether a button or link should be used so technically you can pick either one and not fail WCAG (assuming the element is labeled properly and follows other WCAG guideance). It might not be the best UX but it wouldn't fail WCAG.

Also note that <a type="button"> is not a construct that I'm aware of. Yes, the <a> does have a type attribute but the spec says it's a "Hint for the type of the referenced resource". I don't think specifying "button" for the type will buy you anything. The screen reader ignores that attribute.

slugolicious
  • 15,824
  • 2
  • 29
  • 43