question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for HTML5 boolean attributes

See original GitHub issue

I haven’t gone into this extensively, but you should at least consider adding autofocus to your list of boolean attributes. Thanks 😃

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:27 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
mckameycommented, Mar 16, 2014

If you prefer the list:

[ ] allowfullscreen
[ ] async
[ ] autofocus
[x] autoplay
[ ] checked
[ ] compact
[x] controls
[ ] declare
[ ] default
[x] defaultchecked
[x] defaultmuted
[x] defaultselected
[ ] defer
[ ] disabled
[x] draggable
[x] enabled
[ ] formnovalidate
[ ] hidden
[x] indeterminate
[ ] inert
[ ] ismap
[ ] itemscope
[x] loop
[ ] multiple
[ ] muted
[ ] nohref
[ ] noresize
[ ] noshade
[ ] novalidate
[ ] nowrap
[ ] open
[x] pauseonexit
[ ] readonly
[ ] required
[ ] reversed
[x] scoped
[ ] seamless
[ ] selected
[ ] sortable
[x] spellcheck
[x] translate
[ ] truespeed
[ ] typemustmatch
[x] visible
1reaction
mckameycommented, Mar 16, 2014

I was searching for a similar list when I came upon this discussion. I thought you might benefit from an updated list. I started with @mathiasbynens’ idea to grep the spec but modified it to only look within the IDL blocks and look at the single-page spec. Then I stripped all the markup and removed every readonly attribute (since these can’t be set via markup). I sorted / deduped and this is what I am seeing. Note that it includes a few <video> and <audio> tag attributes which aren’t present in your list as of 10 months ago.

$ curl -s "http://www.w3.org/TR/html51/single-page.html" | grep "attribute boolean" > boolean.txt
allowFullscreen
async
autofocus
autoplay
checked
compact
controls
declare
default
defaultChecked
defaultMuted
defaultSelected
defer
disabled
draggable
enabled
formNoValidate
hidden
indeterminate
inert
isMap
itemScope
loop
multiple
muted
noHref
noResize
noShade
noValidate
noWrap
open
pauseOnExit
readOnly
required
reversed
scoped
seamless
selected
sortable
spellcheck
translate
trueSpeed
typeMustMatch
visible

You will probably want to lowercase these for your purposes. Thanks for the starter ideas.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Boolean attributes - HTML 5
A number of attributes in HTML5 are boolean attributes . The presence of a boolean attribute on an element represents the true value,...
Read more >
Boolean attributes - HTML Spec
A number of attributes are boolean attributes . The presence of a boolean attribute on an element represents the true value, and the...
Read more >
HTML attribute reference - HTML: HyperText Markup Language
Attribute Name Elements Description accept‑charset List of supported charsets. align, , , , , , , , , , , , , Specifies the horizontal...
Read more >
HTML Boolean Attributes | JoeQuery
A number of attributes are boolean attributes. The presence of a boolean attribute on an element represents the true value, and the absence...
Read more >
What does it mean in HTML 5 when an attribute is a boolean ...
A number of attributes are boolean attributes. The presence of a boolean attribute on an element represents the true value, and the absence...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found