Home  >  Article  >  Web Front-end  >  What are html hidden attributes

What are html hidden attributes

藏色散人
藏色散人Original
2021-04-01 10:30:425625browse

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.

What are html hidden attributes

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 165e15f7f93ab1e9f266d21f9a96a5f7.

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Related articles

See more