About this AccessLint rule
An <input> element with type="submit", type="button", or type="reset" needs an accessible name so that assistive technologies can communicate the button's purpose to users. When one of these input buttons lacks a value attribute (or an equivalent labeling mechanism like aria-label or aria-labelledby), screen readers may announce it as something generic like "button" or "submit" with no further context. Users who rely on screen readers then have no way to tell what the button does or to distinguish it from other buttons on the page.
Keyboard-only users and voice control users are also affected. Voice control software like Dragon NaturallySpeaking allows users to activate buttons by speaking their accessible name. Without a discernible name, the button becomes difficult or impossible to target by voice.
This rule maps to WCAG 2.1 Success Criterion 4.1.2: Name, Role, Value (Level A). That criterion requires all user interface components to have a name that can be programmatically determined. Because this is a Level A requirement, it is a baseline expectation for any accessible website.
How input buttons get their accessible name
For <input> buttons, the accessible name is computed differently than for <button> elements. A <button> element can take its name from its text content, but an <input> element is a void element with no children. Instead, the accessible name comes from one of these sources, in order of precedence:
- The
aria-labelledbyattribute, which references theidof another element containing the label text. - The
aria-labelattribute, which provides the label text directly. - The
valueattribute.
If none of these are present, the browser may fall back to a default label based on the type (for example, "Submit" for type="submit" in some browsers), but this behavior is inconsistent across browsers and languages. You should always set an explicit name.
How to fix it
The simplest fix is to add a value attribute with descriptive text. The value text is both the visible label on the button and its accessible name, so it keeps the visual and programmatic labels in sync.
If you need the accessible name to differ from the visible text for some reason, use aria-label. If the label text already exists elsewhere on the page, use aria-labelledby to point to it.
Choose a name that clearly describes the action the button performs. Generic labels like "Submit" or "Click here" are technically accessible but may not be helpful when a page contains multiple buttons. Be specific: "Place Order", "Search", "Reset Form", and so on.
Examples
Input button with no accessible name
This button has no value, aria-label, or aria-labelledby. A screen reader might announce it as just "button" or fall back to an inconsistent browser default.
<input type="submit">
Fixed: using the value attribute
Adding a value attribute gives the button both a visible label and an accessible name.
<input type="submit" value="Place Order">
Fixed: using aria-label
If the visible label needs to stay empty or differ from the accessible name, aria-label provides a name directly to assistive technologies.
<input type="button" aria-label="Search flights">
Note that when aria-label is used without a value, the button will appear with no visible text. In most cases, using value is preferable because it provides a visible label for all users.
Fixed: using aria-labelledby
When the label text already exists in another element, aria-labelledby can reference it by id.
<h2 id="checkout-heading">Complete Your Purchase</h2>
<input type="submit" aria-labelledby="checkout-heading">
Multiple button types
The rule applies to type="submit", type="button", and type="reset" equally. Each one needs a discernible name.
<!-- All three have accessible names via value -->
<input type="submit" value="Send Message">
<input type="reset" value="Clear Form">
<input type="button" value="Preview">
Detect accessibility issues automatically
Rocket Validator scans your site with complementary accessibility engines, helping teams find issues across every page.
Help us improve our guides
Was this guide helpful?
๐
Trusted by teams worldwide
Validate at scale.
Ship accessible websites, faster.
Automated HTML & accessibility validation for large sites. Check thousands of pages against WCAG guidelines and W3C standards in minutes, not days.
Scheduled Reports
API Access
Open Source Standards
$7
/ 7 days
Pro Trial
Full Pro access. Cancel anytime.
Start Pro Trial โ
Join teams across 40+ countries