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

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.

The short version

A form is accessible when people can understand, complete, correct, and submit it without guessing.

01

Give every control a real label

Placeholder text is a hint, not a label. It disappears when someone types and often has weak contrast. Use a label whose for value matches the input id, or wrap the control inside the label.

Choose the most specific input type available. Email, url, tel, date, and number fields give browsers and assistive technology more useful information and can trigger better mobile keyboards.

html
<label for="work-email">Work email</label>
<input
  id="work-email"
  name="email"
  type="email"
  autocomplete="email"
  aria-describedby="email-help"
  required
>
<p id="email-help">We will send the review link here.</p>
02

Group choices and explain constraints

Use fieldset and legend for related radio buttons or checkboxes. Put format requirements and limits beside the field before submission, then keep error messages close to the field when validation fails.

  • Do not rely on color alone to identify an error.
  • Move focus to an error summary when a long form fails.
  • Keep entered values after validation.
  • Make the submit button say what happens next.
03

Test the whole path with a keyboard

Tab through the form from the first field to the final action. Focus must remain visible, the order must match the visual flow, and custom widgets must support the same keyboard behavior users expect from native controls.

Native HTML controls solve a surprising amount of this work. Customize them only when the product requirement is worth the added accessibility and maintenance cost.

Official references

  • W3C WAI: Forms tutorial
  • WHATWG: Forms

In this guide

  1. 01Give every control a real label
  2. 02Group choices and explain constraints
  3. 03Test the whole path with a keyboard
Publish a page

Keep going

Related HTML guides

Browse all 24 guides
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
Accessibility5 min read

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.

Read guide
© 2026 HTML DocsInstallSupportPrivacyTermsAPI