Skip to main content
HTML Validation

Element “input” with attribute “type” whose value is “button” must have non-empty attribute “value”.

About This HTML Issue

An <input type="button"> element requires a non-empty value attribute because that attribute provides the button's visible label and its accessible name.

Unlike <input type="submit">, which defaults to a browser-provided label like "Submit", <input type="button"> has no default label. Without a value, the button renders as an empty rectangle with no text, and assistive technologies have nothing to announce to the user. The W3C validator flags this as an error because the HTML specification mandates that <input type="button"> must have a value attribute, and it must not be empty.

If you need a button without visible text (for example, an icon-only button), use a <button> element instead. The <button> element can contain child elements like <img> or <span>, and you can give it an accessible name through aria-label or visually hidden text. The <input> element cannot contain child content, so value is its only mechanism for labeling.

Invalid example

<input type="button" onclick="doSomething()">

Valid examples

Add a non-empty value attribute:

<input type="button" value="Click me" onclick="doSomething()">

Or switch to a <button> element, which is more flexible:

<button type="button" onclick="doSomething()">Click me</button>

Find issues like this automatically

Rocket Validator scans thousands of pages in seconds, detecting HTML issues across your entire site.

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