Hidden Attribute in HTML5
In this article I am going to describe about the use of Hidden attribute in HTML5.
The Hidden attribute is used to hide any content. Hidden attribute is new in HTML5.
When present, it specifies that an element is not yet, or is no longer, relevant. The browser/user agent does not display elements that have the hidden attribute present.
Hidden attribute is an Boolean attribute.
Possible Ways are
- <ElementName hidden>
- <ElementName hidden="hidden">
- <ElementName hidden="true">
It is supported in all major browsers except Internet Explorer.
Example of Hidden Attribute
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<meta charset="utf-8" />
<h2>Hidden Attribute in HTML5</h2>
<p hidden>This paragraph should be hidden.Nobody can see me.</p>
<p>This is a visible paragraph.</p>
<p><b>Note:</b> The hidden attribute is not supported in IE.</p>