What does it mean when an attribute like the hidden attribute is a boolean attribute? Can someone explain this in layman's terms?
相关问题
- HTML5 control
- 有知道比较好的前端开发网站么?
- Embedding snake game to engage website visitors ,
- How to calculate offsetWidth and scrollWidth for o
- canvas toDataURL 转图片部分空白
As the others said, a Boolean has three possible syntax for true:
And one for false:
Except that you have a few exceptions like this one, obviously:
As already stated boolean attributes are attributes that are evaluated either true or false.
However, from HTML5 Spec - http://www.w3.org/TR/html5/infrastructure.html#boolean-attributes
Note that this means that
<div hidden="true">
is not allowed in HTML5.Correct would be either
<div hidden>
or<div hidden="">
or<div hidden="hidden">
or case-insensitive and single quotes/unquoted variations of any of them.