.hide() hides matched elements with display: none (since jQuery 1.0). Instant with no args; with a duration it becomes an animation. The previous display is saved for .show().
Remember
$(".target").hide() // instant
$("p").hide("slow") // 600ms animation
$("#box").hide(400, function () { // ms + complete
// this = current element
});
// "fast" = 200ms · default animated duration = 400ms
Select elements, then hide instantly or with a duration.
Select the element(s) to hide.
Call .hide() for an instant hide, or pass a duration / options.
Optionally pass a complete callback (runs once per element).
Restore later with .show() — saved display comes back.
Piece
Required?
Role
Matched set
Yes
Elements to hide
duration
Optional
ms, "slow", or "fast"
easing
Optional
"swing" or "linear" (1.4.3+)
complete
Optional
Runs after each element finishes
Pseudocode
Pseudocode
for each matched element el:
save current display value in jQuery data
if no duration (or duration is 0):
set display = none // instant; skips queue
else:
animate width, height, opacity → 0
then set display = none
call complete(this = el) once per element
return original matched set
// .show() restores the saved display value
Reference
Cheat Sheet
Keep these facts handy while toggling visibility.
Topic
Detail
Instant
.hide()
Animated
.hide(duration[, easing][, complete])
Since
jQuery 1.0 (easing arg 1.4.3)
Durations
"fast" 200 · default 400 · "slow" 600
vs css
Saves display for correct .show()
DOM
Element stays; layout space gone
Global off
jQuery.fx.off = true
Try it
Live Preview
Hide the sample box instantly, slowly, or show it again.
Browser demo of .hide() / .show() — same idea as the examples below.
Hello — I am the target box.
Result
$("#box").hide()
→ display becomes none (instant)
Code
jQuery Examples
Short, copy-ready snippets. Open DevTools Console, or use Try It Yourself for a live editor.
Load.$("p").hide() hides every paragraph instantly.
Link stays. The <a> is not a paragraph, so it remains visible.
Click.preventDefault stops navigation; $(this).hide() hides the link.
Pattern. Same idea as the official jQuery .hide() click demo.
Edge Cases & Pitfalls
Check these before hiding large or responsive UIs.
css
Prefer .hide() over raw display:none
Raw CSS skips the display cache. Later .show() may restore the wrong layout mode.
queue
Instant hide skips the queue
No duration (or 0) runs immediately and can override queued animations.
a11y
Hidden ≠ removed from a11y tree always
display:none hides from layout and usually from assistive tech. Still manage focus when hiding open dialogs.
fx
jQuery.fx.off forces instant
When effects are off globally, animated .hide() becomes duration 0 — plan for that in tests.
Compatibility
Browser Support
.hide() has been part of jQuery since 1.0. The easing argument arrived in 1.4.3. It works wherever your loaded jQuery version runs.
✓ Stable · jQuery 1.0+
jQuery .hide()
Supported in all browsers that run jQuery 1.0+. Prefer a current jQuery 3.x build for modern projects.
100%jQuery core method
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
.hide()Universal
Bottom line: Safe for everyday UI. Prefer instant hide for large sets; animate only when motion helps understanding.
Analysis
Performance Notes
Approach
Cost
Best for
.hide() instant
Cheap
Bulk hide, tables, lists
.hide("slow")
Layout + paint
Single panels, feedback
Many animated hides
Expensive
Avoid — batch or use CSS classes
Instant hide is fine at scale. Animated hide on dozens of nodes can jank — animate one container instead of every child.
Remember
Key Takeaways
Role: set display: none and remember the old display.
Pair: restore with .show() or flip with .toggle().
Animate: pass duration / "slow" / "fast".
Not remove: nodes stay in the DOM until you .remove().
One line:.hide() is the jQuery way to take elements out of layout while keeping a correct path back via .show().
Frequently Asked Questions
.hide() hides matched elements with display: none. With no arguments it is instant. jQuery saves the previous display value so .show() can restore inline, block, flex, and other modes. Returns the jQuery collection for chaining. Available since jQuery 1.0.
.css("display", "none") only sets CSS. .hide() also stores the previous display in jQuery’s cache so .show() can restore it correctly.
Yes. Pass a duration in ms, or "slow" (600) / "fast" (200). jQuery animates width, height, and opacity, then sets display to none. You can also pass easing, an options object, or a complete callback.
No. Hidden elements stay in the document; they just leave layout. Use .remove() or .detach() to take nodes out of the DOM.
.hide() makes elements invisible and removes them from layout. .show() reverses that and restores the saved display value.
Set jQuery.fx.off = true. All effects, including .hide(), run with zero duration. Useful for tests or reduced motion.
Once per matched element when that element’s animation finishes — not once for the whole set.