Links and buttons
For best accessibility practices, follow these simple rules:
- A link (navigation) should look like a link and be coded like a link.
- A button (action) should look like a button and be coded like a button.
However, there are of course, exceptions to the rule:
- If you are using a
<a>
-tag for an action (as in submit form, even if it takes you to a new URL), change it to a<button>
- If you are using a
<button>
to change URL (location), change it to a<a>
.- However, if it is the action that is changing the URL, keep the
<button>
- If the URL is not reachable by direct linking/deep linking, keep the
<button>
- However, if it is the action that is changing the URL, keep the