If a boolean attribute is present, it is always true. Boolean attributes include autofocus
, inert
, checked
, disabled
, required
, reversed
, allowfullscreen
, default,
loop
, autoplay
, controls
, muted
, readonly
, multiple,
and selected
Boolean values can either be omitted, set to an empty string, or be the name of the attribute; but the value doesn’t have to actually be set to the string true
. All values, including true
, false
, and , while invalid, will resolve to true.
These three tags are equivalent
<input required>
<input required="">
<input required="required">