The .show() method displays matched elements instantly or with a smooth animation. This tutorial covers the no-argument form since jQuery 1.0, duration strings like "slow" and "fast", complete callbacks, how jQuery restores saved display values from .hide(), sequential reveal patterns, comparisons with .css() and .toggle(), the official jQuery API demos, and five practical try-it examples.
01
Instant
No args
02
Animated
Duration
03
Callback
complete
04
vs .hide()
Pair API
05
Restores
display
06
Since 1.0
Core API
Fundamentals
Introduction
After you hide content with jQuery, you need a reliable way to bring it back. The .show() method reveals matched elements — either instantly or with a fade-and-grow animation — and restores the correct display value for each element.
With no parameters, .show() is the simplest approach: elements become visible immediately. This is similar to .css( "display", "block" ), but smarter: jQuery reads the display value it saved when you previously called .hide(), so an inline element returns to inline, not block.
Pass a duration — milliseconds, "slow" (600 ms), or "fast" (200 ms) — and .show() animates width, height, and opacity while revealing the element. Pair it with .hide() for complete show/hide control. Browse the jQuery DOM hub for related methods.
Concept
Understanding the .show() Method
.show( [duration ] [, complete ] ) operates on a jQuery collection. Each matched element is displayed; the method returns the same collection for chaining. Elements must exist in the DOM — typically they were hidden with .hide(), CSS display: none, or markup that starts hidden.
When animation is involved, the complete callback fires once per matched element after that element’s animation finishes. Inside the callback, this refers to the DOM element. Use it to update text, focus inputs, or chain the next animation in a sequence.
💡
Beginner Tip
The official jQuery demo hides paragraphs with CSS, then calls $( "p" ).show( "slow" ) when a button is clicked. The paragraphs grow and fade in over 600 ms — a classic reveal pattern for hidden content.
Foundation
📝 Syntax
jQuery .show() supports several forms:
Instant show — since 1.0
jQuery
.show()
No arguments — reveals elements immediately with no animation.
Restores the saved display value from a prior .hide() call.
Animated show with duration
jQuery
.show( duration [, complete ] )
// Milliseconds (default animation length is 400 when duration provided)
.show( 600 )
// Named speeds
.show( "slow" ) // 600 ms
.show( "fast" ) // 200 ms
Options object — since 1.0
jQuery
.show( {
duration: 400,
easing: "swing",
complete: function() {
// Called once per matched element when its animation finishes
}
} )
Four ways to change visibility — know which one fits your UI.
.show()
visible
Reveal elements — restores saved display from .hide() — optional animation
.hide()
invisible
Hide elements and save display — pair with .show() for toggle UIs
.toggle()
flip
Show hidden elements, hide visible ones — one method for on/off controls
.css('display')
raw CSS
Direct style change — always sets a fixed value, no saved display, no animation
Hands-On
Examples Gallery
Example 1 covers instant showing. Examples 2–5 follow the official jQuery API documentation — slow reveal of hidden paragraphs, sequential sibling animation, image show with callback, and form-driven show with text update. Use DevTools or the Try-it links to run each snippet in the browser.
📚 Getting Started
Instant show and the official slow paragraph demo.
Example 1 — Instant Show (No Animation)
The simplest form — reveal matched elements immediately with no duration argument.
jQuery
$( ".target" ).show();
// Restores saved display from .hide()
// Roughly like .css( "display", "block" ) but smarter for inline/flex elements
Before: .target elements hidden (display: none)
After .show(): elements visible in layout instantly
Inline elements stay inline; block elements stay block
No animation — fires immediately
How It Works
With zero arguments, jQuery sets the appropriate display value on each matched element right away. If the element was previously hidden with .hide(), jQuery restores the cached display mode instead of forcing block.
Example 2 — Official Demo: Show Hidden Paragraphs Slowly
Paragraphs start hidden in CSS; clicking a button reveals them over 600 milliseconds.
Initial state: paragraphs hidden
Click "Show it": paragraphs grow and fade in over 600 ms ("slow")
All matched <p> elements animate together
Official jQuery API Example 1 pattern
How It Works
When a duration is provided, .show() becomes an animation method. jQuery animates dimensions and opacity in parallel while changing display from none to the restored value.
📈 Animation & Callbacks
Sequential reveals, completion handlers, and interactive show patterns.
Example 3 — Sequential Sibling Reveal
Show the first div, then each next sibling in order — each animation starts when the previous one ends.
Click "Show": first div appears (200 ms "fast")
Callback runs → next sibling shows → repeats until all visible
Click "Hide": all divs hide over 1000 ms
Official jQuery API Example 2 pattern — chained callbacks
How It Works
The named function showNext passes itself as the complete callback. After each div finishes showing, jQuery calls showNext again on the next sibling. This creates a staggered reveal without external timers.
Example 4 — Show with Complete Callback
Reveal a hidden image slowly when a trigger is clicked — official book demo pattern.
Click trigger: #book grows and fades in over 600 ms
When animation ends: complete callback runs
this inside callback → the #book DOM element
Chain focus, logging, or next animation in complete
How It Works
The second argument to .show() is a callback fired after each element’s animation completes. Use it to confirm the reveal finished before running follow-up logic like focusing an input or loading related content.
Example 5 — Form Confirmation with Animated Show
When the user types yes and submits, show a paragraph over 4 seconds and update its text in the callback.
Type "yes" + submit: <p> animates in over 4000 ms
On complete: text changes to "Ok, DONE! (now showing)"
Other span/div elements hide fast on every submit
Official jQuery API Example 3 pattern — conditional show
How It Works
Combine conditional logic with animated .show(). The 4000 ms duration gives users time to see the reveal; the callback updates the message only after the animation finishes. Other elements hide immediately with .hide( "fast" ).
Applications
🚀 Common Use Cases
Reveal hidden panels — show accordion sections, FAQ answers, or settings blocks.
Restore after .hide() — bring back menus and tooltips hidden on blur or timeout.
Step wizards — show the next step and hide the current one in multi-page forms.
Loading complete — show content instantly when Ajax data arrives.
Staggered lists — reveal items one-by-one with sequential callbacks.
User confirmation — animate success messages after form validation passes.
🧠 How .show() Reveals Elements
1
Match target elements
jQuery collection identifies which hidden nodes to reveal.
Elements
2
Restore display value
Cached display from .hide() applied — inline, block, flex, etc.
Cache
3
Show instantly or animate
No duration → immediate visibility. With duration → animate size and opacity while revealing.
Effect
4
✓
Return jQuery collection
Same matched set returned for chaining — elements participate in layout again.
Important
📝 Notes
Available since jQuery 1.0; easing parameter added in jQuery 1.4.3.
No-argument form shows instantly — restores saved display, not always block.
"slow" = 600 ms, "fast" = 200 ms; numeric default when animating is 400 ms.
With duration 0 or jQuery.fx.off = true, animation is skipped.
Callback runs once per matched element, not once for the whole animation batch.
Does not override display: none !important — use class toggling instead.
Animating many elements at once may affect performance; profile if needed.
Compatibility
Browser Support
.show() has been part of jQuery since 1.0+. It uses standard CSS display and jQuery's built-in effects engine — no browser-specific APIs. Works in all browsers supported by your jQuery build — IE6+ through modern evergreen browsers in legacy jQuery versions, and all current browsers in jQuery 3.x and 4.x.
✓ jQuery 1.0+
jQuery .show()
Universal visibility API across jQuery 1.x, 2.x, 3.x, and 4.x. Pair with .hide() for saved display restoration and .toggle() for flip visibility UIs.
100%With jQuery loaded
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
.show()Universal
Bottom line: Default choice when revealing elements previously hidden with .hide() or CSS display none.
Wrap Up
Conclusion
The jQuery .show() method displays matched elements instantly or with animation. Call it with no arguments for immediate visibility, pass "slow", "fast", or a millisecond value to animate, and supply a callback to run code when each element finishes appearing.
Unlike raw display: block, jQuery restores the correct layout mode saved by .hide(). Next up: flip visibility with one call via .toggle().
Confuse .show() with inserting new DOM nodes — it only reveals existing ones
Summary
Key Takeaways
Knowledge Unlocked
Six things to remember about .show()
The visibility method that restores saved display from .hide().
6
Core concepts
⚡01
Instant
No args
Fast
🎬02
Animated
slow/fast
Reveal
✓03
Callback
complete
Chain
↔04
vs .hide()
Pair API
Toggle
💾05
Restores
display
Layout
→06
Chain
jQuery
Return
❓ Frequently Asked Questions
.show() displays matched elements by restoring their display property. With no arguments it happens instantly. jQuery uses the display value saved when .hide() was called — so inline, block, flex, and other modes come back correctly. Returns the jQuery collection for chaining. Available since jQuery 1.0.
.css('display', 'block') always sets block layout. .show() restores whatever display value jQuery saved — an inline span becomes inline again, not block. Use .show() after .hide() for correct layout restoration.
.hide() makes elements invisible (display: none) and saves the original display. .show() reverses that process. They are complementary visibility methods — pair them for menus, modals, accordions, and toggle UIs.
Yes. Pass a duration in milliseconds, or the strings 'slow' (600ms) or 'fast' (200ms). jQuery animates width, height, and opacity together while revealing the element. You can also pass an options object or a complete callback. With no duration, the show is instant.
No. If an element uses display: none !important in CSS, .show() cannot override it. Prefer toggling CSS classes with .addClass(), .removeClass(), or .toggleClass() instead. Alternatively .attr('style', 'display: block !important') works but overwrites the entire style attribute.
Set jQuery.fx.off = true globally. All jQuery effects, including .show(), then run with zero duration — effectively instant. Useful in tests or when motion must be reduced for accessibility. Reset to false to re-enable animations.
Did you know?
Calling .show() on an element that was never hidden with jQuery still works — jQuery picks a sensible default display (often block for divs). But the real power appears when you pair it with .hide(): an inline span hidden and shown returns to inline, not block. Also, display: none !important in your stylesheet blocks .show() entirely — toggle CSS classes instead when !important rules are in play.