Skip to main content
HTML Validation

Bad value “false” for attribute “hidden” on element X.

About This HTML Issue

All HTML elements may have the hidden boolean attribute set. When specified on an element, it indicates that the element is not yet, or is no longer, relevant, so browsers won’t render it.

Boolean attributes don’t accept values, its presence represents the true value and its absence represents the false value.

<!-- This is invalid because the hidden attribute should not have a value set -->

<div hidden="false"></div>

<!-- The correct way to hide a div is like this -->

<div hidden>This will be hidden</div>

<!-- And to show the element, we just don't hide it -->

<div>This won't be hidden</div>

Last reviewed: October 27, 2022

Was this guide helpful?

Find issues like this automatically

Rocket Validator scans thousands of pages in seconds, detecting HTML issues across your entire site.

Ready to validate your sites?
Start your free trial today.