The hiddenglobal attribute tells the browser not to present an element’s contents. Use it when content is not relevant yet—for example a panel that appears after a step completes.
Modern HTML treats hidden as an enumerated attribute: the default hidden state, or until-found for content that stays searchable. It is not the same as <input type="hidden">, which still submits form data.
Baseline · Widely available.
The default hidden state is stable across modern browsers since about July 2015. Not deprecated.
Limited availability — until-found.
hidden="until-found" works in Chromium and newer Firefox, but not Safari. Treat it as progressive enhancement.
Syntax
HTML Syntax
syntax.html
<element hidden[="hidden|until-found"]>
Works on any HTML element. An empty value or the keyword hidden means fully hidden; until-found means hidden until search or fragment navigation finds it.
Start visible. The paragraph has no hidden attribute at first.
Read/write hidden.el.hidden = true adds the attribute; false removes it.
Toggle with !.el.hidden = !el.hidden flips the current state.
Prefer the attribute. Do not leave hidden in place and override it with CSS display.
Example 3 — hidden="until-found"
Keep a section collapsed but revealable via Find in page or a fragment link (where supported).
HTML
<p><a href="#extra">Jump to hidden section</a></p>
<section id="extra" hidden="until-found">
<h2>Extra notes</h2>
<p>This section can be revealed by the fragment link or Find in page.</p>
</section>
This section can be revealed by the fragment link or Find in page.
Behavior depends on browser support for until-found.
How It Works
Use until-found. Content is not shown, but Find in page / fragment navigation can still match it.
On a match. Supporting browsers fire beforematch, remove hidden, and scroll to the element.
Layout differs. Unlike plain hidden, until-found often keeps a box (via content-visibility: hidden).
Check support. Not available in Safari yet — provide a non-critical enhancement only.
Edge Cases & Pitfalls
Most bugs come from treating hidden like CSS-only visibility or like type="hidden".
boolean trap
hidden="false" still hides
Only remove the attribute (or set element.hidden = false) to show content. Invalid values stay in the hidden state.
css
Do not override with display
A CSS display: block can make a still-hidden element appear. Remove hidden instead of fighting the UA style.
a11y
Hidden from everyone
Do not use hidden to hide content from only one presentation. Screen readers also skip the default hidden state.
links
Do not link to plain hidden content
Linking to a normally hidden section is incorrect. Use until-found when fragment navigation should reveal it.
scripts
Descendants stay active
Scripts inside a hidden tree can still run, and nested form controls can still submit. Hiding is presentation, not a sandbox.
Compatibility
Browser Support
hidden is an HTML global attribute in the browser. It is not a Node.js, Deno, or Bun API.
✓ Baseline · Widely available
hidden
Default hidden state is widely available since about July 2015. The until-found value is limited (Chromium/Firefox; not Safari).
97%Global support (default state)
Google ChromeAll · until-found 102+
Full support
Mozilla FirefoxAll · until-found 148+
Full support
Apple SafariAll · until-found: no
Partial
Microsoft EdgeAll · until-found 102+
Full support
OperaAll · until-found 88+
Full support
Samsung InternetModern · until-found 19+
Full support
Internet Explorer11 (default state)
Supported
hiddenWidely supported
Bottom line: Safe to use the default hidden state everywhere. Use until-found only as an enhancement where Safari support is not required.
Remember
Key Takeaways
Role: mark content that is not currently relevant to present.
Values: empty/hidden for full hide; until-found for searchable hide.
Toggle: use element.hidden or add/remove the attribute — not hidden="false".
Not the same as<input type="hidden">.
One line:hidden means “not relevant to show now” — remove it when the content matters again.
Frequently Asked Questions
It marks content that should not be presented to the user right now. In the default hidden state, browsers typically apply display:none so the element is removed from layout and from assistive tech presentation.
Historically it was treated as boolean. In modern HTML it is enumerated: empty/hidden for the hidden state, or until-found for the hidden-until-found state. Invalid values still hide the element.
No. Presence of a non–until-found value (including false or bananas) still puts the element in the hidden state. Remove the attribute or set element.hidden = false in JavaScript to show it.
It hides content but keeps it findable via Find in page or fragment links. On a match, the browser fires beforematch, removes hidden, and scrolls to the element. Support is limited (not Safari).
No. The hidden attribute hides any element from presentation. input type="hidden" is a form control that still submits a value with the form.
Yes. Setting display to something other than none (for example display:block) can show an element that still has hidden. Prefer removing the attribute instead of fighting it with CSS.