$html-docs
InstallDevelopersPricingSign inOpen drive
All HTML guides
Accessibility5 min read·July 29, 2026

Links or Buttons? How to Choose the Right HTML Control

Use links for navigation and buttons for actions, then write labels that make the result clear before someone clicks.

The short version

If the destination changes, use a link. If the current interface changes, use a button.

01

Match the element to the behavior

A link takes the reader to a resource with a URL. A button submits, opens, toggles, or changes something in the current experience. Native elements bring keyboard behavior, focus handling, semantics, and browser features for free.

A clickable div has none of those guarantees. Rebuilding them correctly takes more work than using the element already designed for the job.

html
<a href="/blog/semantic-html-guide">Read the semantic HTML guide</a>
<button type="button" aria-expanded="false" aria-controls="filters">
  Show filters
</button>
02

Write labels around the outcome

Avoid repeated labels such as “Click here” and “Learn more.” Link text should make sense when read out of context. Buttons should name the action: “Publish page,” “Save draft,” or “Open comments.”

03

Preserve familiar browser behavior

  • Let links open in the same tab unless there is a strong reason not to.
  • Do not disable zoom or text selection around controls.
  • Keep visible focus styles.
  • Use type="button" for buttons that should not submit a form.
  • Make the hit area comfortable on touch screens.

Official references

  • WHATWG: Links
  • WHATWG: Button element

In this guide

  1. 01Match the element to the behavior
  2. 02Write labels around the outcome
  3. 03Preserve familiar browser behavior
Publish a page

Keep going

Related HTML guides

Browse all 24 guides
Accessibility8 min read

How to Build Accessible HTML Forms

Connect every field to a label, group related controls, explain errors clearly, and make the full flow work from a keyboard.

Read guide
Accessibility6 min read

How to Create a Clear HTML Heading Structure

Turn a visual page into a dependable outline that helps readers scan, navigate, and understand the content.

Read guide
Accessibility7 min read

How to Make HTML Tables Easy to Read

Use captions, headers, scope, and responsive wrappers so dense data keeps its meaning on every screen.

Read guide
© 2026 HTML DocsInstallSupportPrivacyTermsAPI