What are html hidden attributes

藏色散人
Release: 2021-04-01 10:30:42
Original
5651 people have browsed it

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

Example:

<!DOCTYPE html>
<html>
<body>

<p hidden="hidden">这是一段隐藏的段落。</p>
<p>这是一段可见的段落。</p>

</body>
</html>
Copy after login

Running effect:

这是一段可见的段落。
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template