Skip to content

Instantly share code, notes, and snippets.

@samme samme/html-attributes.md

Last active Apr 6, 2019
Embed
What would you like to do?
Boolean and boolean-like attributes in HTML

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.

  • allowfullscreen
  • async
  • autofocus
  • autoplay
  • checked
  • controls
  • default
  • defer
  • disabled
  • formnovalidate
  • hidden
  • ismap
  • itemscope
  • loop
  • multiple
  • muted
  • novalidate
  • open
  • playsinline
  • readonly
  • required
  • reversed
  • scoped
  • seamless
  • selected
  • sortable
  • typemustmatch

Enumerated; as "on", "off"

  • autocomplete (form)

Enumerated; as "true", "false"

  • contenteditable
  • draggable
  • spellcheck

Enumerated; as "yes", "no"

  • translate

Value is optional

  • download

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.