Web Design

Hidden Until Found

The hidden="until-found" HTML attribute for searchable hidden content

Hidden Until Found

The hidden="until-found" HTML attribute lets you hide content while keeping it discoverable via the browser's Find in Page (Ctrl+F / Cmd+F) and fragment navigation.

How It Works

When a user searches for text inside a hidden="until-found" element:

  1. The browser fires a beforematch event on the hidden element
  2. The hidden attribute is removed
  3. The browser scrolls to the matched content

Example

<div hidden="until-found">
  <p>This content is hidden but searchable via Ctrl+F.</p>
</div>

This is perfect for accordion/collapsible sections — content stays collapsed until the user searches for it, then it automatically expands.

Compared to hidden

AttributeRenderedSearchable (Ctrl+F)
hiddenNoNo
hidden="until-found"NoYes
MDN — hidden global attribute documentation