htmlThe hidden attribute is hidden, which is a Boolean attribute; the hidden attribute can be used to prevent users from viewing an element until certain conditions are matched; and JavaScript can remove the hidden attribute to make this element visible.
The operating environment of this article: Windows7 system, HTML5&&CSS3 version, DELL G3 computer
hidden Definition and usage
hidden attribute is a Boolean attribute.
If this attribute is set, it specifies that the element is still or no longer relevant.
Browsers should not display elements that have the hidden attribute specified.
The hidden attribute can also be used to prevent the user from viewing an element until certain conditions are matched (such as a checkbox being selected). JavaScript can then remove the hidden attribute to make this element visible.
Differences between HTML 4.01 and HTML5
The hidden attribute is new in HTML5.
Differences between HTML and XHTML
In XHTML, attribute abbreviations are prohibited and the hidden attribute must be defined as
Example:
<!DOCTYPE html> <html> <body> <p hidden="hidden">这是一段隐藏的段落。</p> <p>这是一段可见的段落。</p> </body> </html>
Running effect:
这是一段可见的段落。
Recommended learning: "HTML video tutorial" "css Video tutorial》
The above is the detailed content of What are html hidden attributes. For more information, please follow other related articles on the PHP Chinese website!