Another new attribute is the hidden attribute. When a web page element has the hidden attribute, its behavior is very similar to CSS display: none; in that the element will disappear without occupying any page space. The writing method is very simple:
If you are using an old browser that does not support this attribute, you can add the following code in CSS To support it: :
* [hidden] { display: none; }
So, why use the hidden attribute? The meaning is that it is more semantically meaningful and improves the readability of the code. And compared to display:none in CSS, it’s literally simpler!