HTML hidden Attribute

HTML hidden Attribute: This is used to define the visibility of elements. And also as a Boolean attribute. It specifies that an element is no longer relevant when the hidden attribute is present. The hidden attribute can be seen using some condition or JavaScript used to see the hidden content.

HTML hidden Attribute

This attribute can be applied to all HTML elements. While HTML4 does not support the hidden attribute. The hidden attribute is added newly in HTML5.

Syntax: <element hidden>



Browser Support

This attribute is supported by the following browsers:

  • Chrome-6.0
  • Safari-5.1
  • Internet Explorer-11.0
  • Opera-11.1
  • Firefox-4.0

Example: for hidden attribute

<p hidden>This paragraph should be hidden.</p>

Output:

This is a visible paragraph.

Note: The hidden attribute is not supported in IE10 or earlier versions.