In this section, we will learn what the hidden attribute is and how to use it in HTML.
HTML hide element with hidden attribute
The hidden attribute, as the name suggests, is used to hide an element in an HTML document.
Basically, browsers won’t render an element that has this attribute in its opening tag.
We use this attribute when want to keep users from seeing an element until they do some actions in an HTML document.
HTML hidden Attribute Syntax
HTML hidden Attribute Values
The hidden attribute is a boolean attribute. That means we only need to put this element in the opening tag of an element. After that, the element becomes hidden in the document.
Example: hide a div in HTML
Example: HTML button hidden