Bad code
<button type="button" onclick="window.open('https://example.com/other-page')">Link target description</button>
Issues and how to fix them
- A button opening a link will be unexpected behavior for screen reader users. No matter how it is styled.
- Links disguised as buttons won’t show up in the link list of a site in assistive technologies.
- Use links for navigation to other pages or sections, and buttons for actions performed on the current page or within the application.
Good code
<a href="https://example.com/other-page">Link target description</a>