Hi! I am the #a11yParrot. 🦜👋
If a click loads a new page or view, use a link (`<a>`).
If a click changes something on the same page, use a `<button>`.
Repost this every time you have to explain links vs buttons.
(I will until the end of time).
Hi! I am the #a11yParrot. 🦜👋
If a click loads a new page or view, use a link (`<a>`).
If a click changes something on the same page, use a `<button>`.
Repost this every time you have to explain links vs buttons.
(I will until the end of time).
@menelion I love a good edge-case.
You’re not wrong.
Better heuristic: links are for navigation to a URL (including `#fragment` in-page navigation like a TOC), buttons are for actions (including form submit). A submit *may *lead to a new page, but the user intent is “submit,” not “navigate.” It could also trigger a form validation, or add content inline (for example a comment).