Find elements that take no space, then count, reveal, or read their values.
Call $("div:hidden") or scope with $("#panel *").filter(":hidden").
jQuery checks layout space (not only CSS “looks invisible”).
Chain .show(), .each(), or read attributes as needed.
Exclude noise with .not("script") when scanning body.
Remember: during a hide animation, the element stays :visible until the end.
Piece
Required?
Role
:hidden
Yes
Match elements with no layout space
Base selector
No
Limit type — e.g. div:hidden
.filter(":hidden")
No
Recommended performance pattern
Return value
—
jQuery set of hidden elements
Pseudocode
Pseudocode
call $(":hidden") // or $("type:hidden") / .filter(":hidden")
for each candidate element:
if it consumes no layout space
(display:none, type=hidden, 0×0, or hidden ancestor):
include it
else if visibility:hidden or opacity:0 only:
skip it // still "visible" to jQuery
return the jQuery set
Reference
Cheat Sheet
Keep these rules next to :visible.
Topic
Detail
Syntax
$(":hidden") · $("div:hidden")
Since
jQuery 1.0 (meaning refined in 1.3.2 and 3.x)
Opposite
:visible
CSS?
No — jQuery extension
Faster pattern
$("#el *").filter(":hidden")
Not matched
visibility:hidden · opacity:0
Animations
Hidden only after hide animation finishes
Try it
Live Preview
Toggle panels, then Run to see which ones match :hidden.
Panel A (visible)
Panel B (will hide)
Panel C (visibility:hidden — still :visible)
Prep hides B with .hide() and sets C to visibility:hidden. Only B should match :hidden.
Result
Ready — click Prep sample, then Run.
Code
jQuery Examples
Short, copy-ready snippets. Open DevTools, or use Try It Yourself for a live editor.
Click Show all
→ previously hidden sections appear
→ already-visible section stays as-is
How It Works
Select.div:hidden inside the accordion only.
Click. Button runs the reveal once.
show(). Clears display:none on those matches.
Open ones. Already-visible divs are not in the set.
Edge Cases & Pitfalls
These surprises come up often with “invisible” CSS.
space
visibility / opacity ≠ hidden
If the element still occupies layout space, it is :visible to jQuery.
anim
During hide animations it stays visible
While sliding/fading out, the element is still :visible until the animation ends.
ancestors
Hidden parent hides children
A child inside display:none is also :hidden, even if the child has no hide styles of its own.
jq3
jQuery 3: no layout box → hidden
br and empty inlines without boxes are considered :hidden in jQuery 3+.
perf
Heavy use can force layout
Official docs note visibility checks may reflow. Prefer a class flag or scoped .filter(":hidden").
Compatibility
Browser Support
:hidden has been part of jQuery since 1.0 (layout-space meaning clarified in 1.3.2; jQuery 3 refined empty/no-box cases). It works in every browser that runs your loaded jQuery version.
✓ Stable · jQuery 1.0+
jQuery :hidden
Supported across jQuery 1.x, 2.x, and 3.x. Prefer a current jQuery 3.x build and know the jQuery 3 layout-box nuance.
100%With jQuery
Google ChromeAll versions · Desktop & Mobile
Full support
Mozilla FirefoxAll versions · Desktop & Mobile
Full support
Apple SafariAll versions · macOS & iOS
Full support
Microsoft EdgeAll versions · Chromium & Legacy
Full support
Internet ExplorerIE 6+ · Legacy environments
Full support
OperaAll modern versions
Full support
:hiddenUniversal
Bottom line: Safe everywhere jQuery runs. Scope or filter for performance, and do not confuse visibility/opacity with :hidden.
Analysis
Performance Notes
Approach
Cost
Best for
$("#el *").filter(":hidden")
Better
Scoped checks (official tip)
$(":hidden") page-wide
Heavier
Small pages / demos
Track a CSS class yourself
Cheapest
Frequent visibility toggles
Official docs warn that heavy :hidden use may force reflow. Prefer a class you control, or a CSS select plus .filter(":hidden").
Remember
Key Takeaways
Role: match elements that take no layout space.
Opposite::visible — they never both match the same element.
Not enough:visibility:hidden / opacity:0 alone.
Speed: CSS select, then .filter(":hidden").
One line::hidden means “no layout space” — not merely hard to see.
Frequently Asked Questions
:hidden selects elements that are hidden — they consume no space in the document layout. Common cases include display:none, input type="hidden", zero width/height, or a hidden ancestor. Available since jQuery 1.0.
No. Elements with visibility:hidden or opacity:0 still take up layout space, so jQuery treats them as visible. Only elements that consume no layout space match :hidden.
Yes. Every element selected by :hidden is not selected by :visible, and vice versa. They are complementary filters in jQuery.
No. It is a jQuery extension and cannot use native querySelectorAll(). Official docs recommend a CSS scope first, then .filter(":hidden") for better performance.
In some browsers, $("body").find(":hidden") can also match head, title, script, and other non-visible document nodes. The official demo excludes script tags before counting user-facing hidden elements.
Starting with jQuery 3, elements without layout boxes — such as br and empty inline elements — are considered :hidden. This slightly refines how :hidden and :visible divide the DOM.