When to use a button and a link
For most document type websites the question between links and buttons doesn't really exist. But in application type websites, it's often that developers don't pick the right one or that designers make links look like buttons.
So to make it clear:
<a>is for a page change or a new tab. When changing page, a screen reader user will be automatically moved to the top of the page and will start reading it from there.
<button>is for activating something like a modal or a form. Once pressed, even if things change in the page, it doesn't move a screen reader user somewhere else and it doesn't vocalize anything.
To do this, the developer has to use the
One last thing: I don't care about your reasons, don't replace a
<button> by a
Next: The mess of strong b em and i
Generated: November 12th, 2021