Warning Boolean attribute given a misleading value

Why disabled="false" still disables the element, and the only values that actually mean "off" for a boolean HTML attribute.

The validator warns when a boolean attribute (disabled, checked, required, readonly, hidden, and similar) is given a value that isn't empty, isn't the attribute's own name, and looks like it's trying to mean "false".

Example

<!-- Still disabled — the value is ignored -->
<input disabled="false">
<input disabled="0">

<!-- Actually enabled: omit the attribute -->
<input>

<!-- Valid ways to write "disabled" -->
<input disabled>
<input disabled="">
<input disabled="disabled">

Why it matters

HTML boolean attributes work by presence, not by their value — the spec defines them as true if the attribute is present at all, and false only if it's completely absent from the tag. disabled="false" is a very natural thing to write coming from JavaScript or most other languages, where a string like "false" would be falsy or meaningfully different from "true". In HTML markup it isn't: the attribute is present, so the element is disabled, exactly as if you'd written disabled="true" or just disabled. This is one of the most common sources of "why is this still disabled/checked/required when I set it to false" bugs, especially in server-rendered templates that stringify a boolean into the attribute value.

Frequently asked questions

How do I actually turn a boolean attribute off?

Remove the attribute from the tag entirely — there is no value you can set that means "false". In JavaScript, use element.removeAttribute("disabled") or the more direct element.disabled = false, which handles this correctly for you.

Is this different in frameworks like React or Vue?

Frameworks that manage the DOM for you (React, Vue, and similar) typically handle boolean props correctly behind the scenes — passing disabled={false} in React removes the attribute rather than writing the literal string "false". This issue is specifically about raw HTML markup or template output where the value gets stringified directly into the attribute.