HTML hiddenAttribute

HTML 全局属性HTML Global Attributes

Examples

Hidden paragraph:

<p hidden>This is a hidden paragraph.</p>

Try it yourself »

Browser Support

The numbers in the table specify the first browser version that supports the attribute.

Attribute
hidden 6.0 11.0 4.0 5.1  11.1

Definition and Usage

The hidden attribute specifies whether an element should be hidden.

Hidden elements are not displayed.

If this attribute is used, the element is hidden.

You can set the hidden attribute so that users can see an element only when certain conditions are met (such as selecting a checkbox, etc.). Then, you can use JavaScript to remove the hidden attribute, making the element visible.


Differences between HTML 4.01 and HTML5

The hidden attribute is a new attribute in HTML5.


Differences between HTML and XHTML

In XHTML, attribute minimization is forbidden, and the hidden attribute must be defined as <element hidden="hidden">.


Syntax

<element hidden>


HTML 全局属性HTML Global Attributes Other Extensions