A link is not a button, and a button is not a link

Links and buttons may look identical on a webpage, but they serve different purposes and are interpreted differently by browsers, screen readers, and keyboard users. A link (<a>) is designed for navigation. A button (<button>) is designed to perform an action.

A link is not a button, and a button is not a link

One of the fastest ways to spot an inexperienced front-end developer is to look at how they handle links and buttons.

It sounds trivial. It's not.

Many accessibility problems start with developers choosing the wrong HTML element and then trying to force it to behave like something else.

A link is for navigation.

A button is for actions.

Those two things are not interchangeable.

Unfortunately, modern websites are full of links that act like buttons, buttons that act like links, and clickable <div> elements pretending to be both.

The page may look fine. The accessibility experience is often a mess.

The rule is simple

If clicking an element takes the user somewhere else, use a link.

<a href="/products/wheelchair-ramp">
    View product details
</a>

Examples include:

  • Opening a product page
  • Reading a blog article
  • Downloading a PDF
  • Navigating to another page
  • Jumping to another section of the same page
  • Opening an external website

If clicking an element performs an action on the current page, use a button.

<button type="button">
    Open menu
</button>

Examples include:

  • Opening a modal window
  • Submitting a form
  • Expanding an accordion
  • Toggling a menu
  • Applying a filter
  • Adding an item to a shopping cart

That's the entire decision process.

Yet many websites get it wrong.

Why assistive technology users care

Most users never think about the difference between a link and a button because they interact visually.

Screen reader users don't.

Assistive technologies expose links and buttons differently because they serve different purposes.

When a screen reader announces "link," users expect navigation.

When it announces "button," users expect an action.

Those expectations are built from years of using websites.

When a developer creates a link that opens a modal window instead of navigating, the user receives one message and experiences something entirely different.

The result is confusion.

Accessibility failures are often caused by broken expectations rather than broken functionality.

Keyboard behavior is different

Links and buttons also respond differently from the keyboard.

A standard button can be activated with both Enter and Space.

A standard link is typically activated with Enter.

Many developers discover this only after replacing native controls with custom JavaScript components.

They create a clickable <div> element, attach an event listener, and assume the job is finished.

It isn't.

Now they must recreate:

  • Keyboard support
  • Focus management
  • Screen reader semantics
  • Disabled states
  • Accessible names
  • Expected browser behavior

Native HTML already provides all of that.

Throwing it away creates work and usually introduces accessibility bugs.

The problem with fake links

One of the most common accessibility mistakes is using an anchor tag without an href attribute.

For example:

<a onclick="openModal()">
    Open dialog
</a>

Visually, this may look like a link.

Semantically, it often isn't.

Many assistive technologies will not treat the element as a true link because it lacks a valid destination.

The developer sees a link.

The screen reader user may not.

This creates inconsistent experiences across browsers and assistive technologies.

A button would have been the correct solution from the beginning.

The problem with fake buttons

The opposite mistake is equally common.

A developer creates a button and uses JavaScript to redirect the user to another page.

<button onclick="window.location='/contact'">
    Contact us
</button>

The visual result works.

The semantic meaning is wrong.

Users are told they are activating a button. Instead, they are taken to another page.

That disconnect may seem minor to a developer testing with a mouse, but it creates unnecessary friction for users who depend on predictable behavior.

If the purpose is navigation, use a link.

Buttons can do things links cannot

Another reason the distinction matters is that buttons and links have different capabilities.

Buttons can be disabled.

<button disabled>
    Submit
</button>

Links cannot.

Buttons participate naturally in forms.

Links do not.

Buttons are designed for user actions.

Links are designed for destinations.

Trying to force one element to behave like the other usually leads to extra code and more accessibility issues.

How screen reader users navigate

Many developers are surprised to learn that screen reader users often navigate pages by pulling up lists of links or lists of buttons.

Instead of reading every word on a page, they can jump directly between interactive elements.

Imagine a user opening a list of links and hearing:

  • Open menu
  • Expand section
  • Show filters
  • Close dialog

Those are actions, not destinations.

They should have been buttons.

Now the page structure no longer reflects reality.

The user has to spend additional time figuring out what each control actually does.

A real-world example

A law firm website recently used anchor tags for every accordion section on its FAQ page.

Each question was coded as a link.

Clicking the link did not navigate anywhere. It simply expanded hidden content below the question.

The design worked visually.

The accessibility experience did not.

Screen readers announced every question as a link. Keyboard users expected navigation. The code provided neither.

Replacing the links with native buttons required only a few minutes of development time and immediately fixed the semantic issue.

No redesign was necessary.

No accessibility widget was required.

Just better HTML.

A practical checklist

Use a link when:

  • The user navigates to another page
  • The user opens an external website
  • The user downloads a file
  • The user jumps to another section of a page
  • The user opens a document or resource

Use a button when:

  • The user submits a form
  • The user opens or closes a modal
  • The user expands or collapses content
  • The user toggles a menu
  • The user changes a setting
  • The user filters search results
  • The user performs an action without leaving the page

Good accessibility starts with HTML

Many accessibility audits focus on ARIA attributes, color contrast, focus indicators, and automated testing tools.

Those issues matter.

But a surprising number of ADA compliance failures originate from something much simpler: choosing the wrong HTML element.

Developers often spend hours writing JavaScript to make custom controls behave correctly when the browser already provides accessible controls for free.

A link is not a button.

A button is not a link.

The browser knows the difference. Screen readers know the difference. Keyboard users know the difference.

Your HTML should know the difference too.

Frequently Asked Questions

Use a link whenever the user is being taken somewhere else. Examples include opening another page, downloading a PDF, viewing a product page, visiting an external website, or jumping to an anchor location on the same page.
Use a button whenever the user is performing an action without leaving the current page. Examples include opening menus, submitting forms, applying filters, toggling settings, expanding accordions, and opening dialogs.
Screen readers announce links and buttons differently. Users rely on those announcements to understand what will happen when they interact with a control. Using the wrong element creates confusion and makes websites harder to use.
Technically yes, but it is generally considered poor semantic HTML. If clicking the control takes the user to a different page, a link is usually the correct element.
A link can be programmed to open a modal, but this is usually the wrong semantic choice. Opening a modal is an action, not navigation, so a button is generally more appropriate.
Often no. An anchor element without an href attribute may not be recognized as a true link by browsers and assistive technologies. If the control performs an action, use a button instead.
Native links and buttons include built-in keyboard support, focus behavior, and accessibility semantics. A clickable
requires developers to manually recreate all of these features, which often leads to accessibility failures.
Many do. Screen readers provide shortcuts that allow users to move through a page by jumping between links, buttons, headings, form controls, and other elements. Accurate semantics make this navigation more efficient.
No. HTML links do not support a native disabled state. Buttons can be disabled using the disabled attribute.
Buttons typically respond to both Enter and Space. Links are generally activated with Enter. This difference is one reason why replacing native elements with custom controls can create usability issues.
It can be. Using incorrect elements may affect keyboard accessibility, semantic structure, screen reader compatibility, and predictable behavior, all of which are covered by multiple WCAG success criteria.
While the ADA itself does not specify HTML elements, ADA-related accessibility evaluations often rely on WCAG standards. Using proper semantic HTML helps organizations meet accessibility expectations and reduces the risk of accessibility complaints.
Semantic HTML means using elements according to their intended purpose. Examples include using headings for headings, buttons for actions, forms for data collection, and links for navigation. Semantic HTML provides meaning that browsers and assistive technologies can understand.
One of the most common mistakes is using a link to trigger an action such as opening a modal, expanding an accordion, or toggling a menu. These interactions should typically be implemented with buttons rather than links.
Janeth

About Janeth

Comments (0)

No comments yet.

Get More Info