We'd like to set Google Analytics cookies to learn how people use the Knowledge Base, so we can improve it. We set them only if you accept.

Skip to main content
Digital Accessibility Knowledge Base

label

Web validation

Form controls must have programmatically associated labels.

Labels give every form field a clear programmatic name so assistive technology can announce its purpose. When a label is absent, or not associated with the form field correctly, screen-reader users cannot understand what information to enter, and people with limited dexterity lose the larger clickable target that a label provides. Clear labeling also helps browsers, form-fill tools, and automated testing identify each control.

Pass Patterns

Explicit <label> associated with an input via id

The label's for attribute matches the input's id, so the label text becomes the input's accessible name.

HTML
<label for="email">Email address</label>
<input type="email" id="email" name="email" />

Implicit <label> wrapping the control

The <label> wraps the input, which associates the two without needing for and id.

HTML
<label>
    First name
    <input type="text" name="first-name" />
</label>

Label referenced with aria-labelledby

The input's aria-labelledby attribute references the id of a <span> that contains the label text.

HTML
<span id="last-name">Last Name</span>
<input type="text" aria-labelledby="last-name" />

An accessible name provided by an aria-label attribute

Note that this method is not recommended because the input field will lack a visible label which may violate the requirement of Success Criterion 3.3.2 Labels or Instructions.

HTML
<input type="text" aria-label="First Name" />

Fail Patterns

Input missing a label

The input has no label of any kind, so it has no accessible name.

HTML
<input type="text" id="username" />

The <label> element is not programmatically associated with the <input> field

The label is visible, but without for/id or wrapping, it isn't connected to the input.

HTML
<label>Email address</label>
<input type="email" name="email" />

WCAG techniques

Sufficient techniques

Advisory techniques

Failure techniques

ACT Rules

Try It Yourself

Using a screen reader

New to screen reader testing, or need a refresher?
Review this article first: Practical guides for using screen readers

  1. Load the page and open a screen reader.
  2. Move focus to the form field.
  3. Listen for the field's name.

Expected result: The screen reader announces the field's label (for example, “Email address, edit text”).

Actual result: The screen reader only announces the field type, without a name that conveys its purpose.

FAQ

How does this issue relate to 4.1.2 Name, role, value?

SC 4.1.2 requires that every user-interface component expose a programmatic name, role, and, where applicable, value. Inputs without an accessible name violate that requirement.

Why is this issue marked as Critical?

Without a programmatic label, assistive-technology users cannot determine what data a field expects, leading to form errors and abandonment. Missing labels also reduce the clickable area for users with motor disabilities. Because the defect blocks essential form interaction across browsers and assistive technologies, it is classified as Critical.

Standards and Regulations

StandardSuccess CriterionReference
WCAG 2.24.1.2 Name, Role, Value (A)For all user interface components, the name and role can be programmatically determined; states, properties, and values that can be set by the user can be programmatically set; and notification of changes to these items is available to assistive technologies.
EN 301 5499.4.1.2 Name, Role, ValueSame as the WCAG text.
Section 5081194.22(n)When electronic forms are designed to be completed on-line, the form shall allow people using assistive technology to access the information, field elements, and functionality required for completion and submission of the form, including all directions and cues.
508 Trusted Tester1.3.1-programmatic-label, 5.CThe combination of the accessible name, accessible description, and other programmatic associations (e.g., table column and/or row associations) describes each input field and includes all relevant instructions and cues (textual and graphical).

Personas impacted by this issue