The only value disabled
is allowed to have is disabled
. You can omit everything except the value (disabled
) in HTML 4 and earlier. You can omit everything except the name (also disabled
) in HTML 5.
From the spec:
A number of attributes are boolean attributes. The presence of a
boolean attribute on an element represents the true value, and the
absence of the attribute represents the false value.
If the attribute is present, its value must either be the empty string
or a value that is an ASCII case-insensitive match for the attribute's
canonical name, with no leading or trailing whitespace.
The values "true" and "false" are not allowed on boolean attributes.
To represent a false value, the attribute has to be omitted
altogether.
This is fine:
disabled
This is fine:
disabled="disabled"
This is fine:
disabled=disabled
This is not HTML:
disabled="true"
This is not HTML:
disabled="You know it"
You can expect most browsers to perform error recovery on invalid values, but that is no reason not to simply write real HTML in the first place.