jQuery show() Method

Beginner
6 min read
Updated: Oct 2026
5 examples
Live preview

What Is show()?

.show() displays matched elements (since jQuery 1.0). With no arguments it is instant and restores the display value saved by .hide() — so inline, block, flex, and others come back correctly. With a duration it becomes an animation.

Remember
$(".target").show()                 // instant
$("p").show("slow")                 // 600ms animation
$("#box").show(200, function () {}) // duration + complete

// Not the same as always forcing block:
// .css("display", "block")  vs  restore saved display

// Pair with the opposite:
$(".panel").hide()
$(".panel").show()
NeedUse
Reveal (restore display).show()
Hide (save display).hide()
Flip visibility.toggle()
Set a CSS property.css()

How to Use show()

Select hidden elements, call show, optionally animate and run a callback.

  1. Select the element(s) you want to reveal.
  2. Call .show() for an instant reveal, or pass a duration / options.
  3. Optionally add a complete callback (runs once per matched element).
  4. Chain further methods on the same collection if needed.
PieceRequired?Role
jQuery collectionYesElements to display
durationNoms, "slow", or "fast"
easingNoswing / linear (1.4.3+)
completeNoRuns after each element finishes
optionsNoMap of effect options

Pseudocode

Pseudocode
for each element in matched set:
  saved = display saved by .hide() (if any)
  if no duration:
    set display to saved (or default for that tag)
  else:
    animate width, height, opacity
    then set display to saved
    then call complete (this = element)

return matched set

// Rough idea without restore:
// .css("display", "block") always forces block

Cheat Sheet

Keep these facts handy while revealing elements.

TopicDetail
Syntax.show() · .show(duration[, complete]) · options
SincejQuery 1.0 (easing arg 1.4.3)
"fast" / "slow"200ms / 600ms
Default duration400ms when animating
DisplayRestores saved value — not always block
!importantCannot override display: none !important
jQuery.fx.offtrue → all effects instant
vs .toggle()Always show vs flip hide/show

Live Preview

Hide a demo panel, then reveal it with instant or animated .show().

Hello from .show()

Browser demo of .show() — same idea as the examples below.

Result
Ready — hide first, then show.

jQuery Examples

Short, copy-ready snippets. Open DevTools Console, or use Try It Yourself for a live editor.

Example 1 — Instant .show()

Reveal a hidden element immediately with no animation.

jQuery
// <div id="box" style="display:none">Hello</div>
$("#box").show();
Try It Yourself

How It Works

  1. Hidden start. The box begins with display: none.
  2. No args. Instant reveal — no duration.
  3. Display restored. The element reappears in the document flow.
  4. Chainable. The jQuery object is returned.

Example 2 — Official Demo: show("slow")

Animate hidden paragraphs into view over 600 milliseconds.

jQuery
// <p style="display:none">Hello</p>
// <p style="display:none">World</p>
$("p").show("slow");
Try It Yourself

How It Works

  1. Duration. "slow" means 600ms.
  2. Animate. Width, height, and opacity change together.
  3. Then visible. Final display is restored.
  4. All matches. Every p is shown.

Example 3 — Complete Callback

Run code after the show animation finishes (once per element).

jQuery
$("#msg").show(400, function () {
  $(this).text("Now visible");
});
Try It Yourself

How It Works

  1. Animate. 400ms show runs first.
  2. Callback. Fires when that element finishes.
  3. this. Inside the function, this is the DOM element.
  4. Per element. Multiple matches → multiple callback calls.

Example 4 — Restore vs Force block

After .hide(), .show() brings back the original display mode.

jQuery
// <span id="label">Inline</span>
$("#label").hide();          // saves display: inline
$("#label").show();          // restores inline
// NOT the same as:
// $("#label").css("display", "block");
Try It Yourself

How It Works

  1. Hide saves. jQuery stores the current display.
  2. Show restores. The span becomes inline again.
  3. css block. Would force block layout instead.
  4. Prefer show. Safer for mixed inline / block / flex UIs.

Example 5 — Official Pattern: Chain Next

Show the first hidden div, then the next, in sequence via the callback.

jQuery
$("div.step").first().show("fast", function showNext() {
  $(this).next("div.step").show("fast", showNext);
});
Try It Yourself

How It Works

  1. Start. The first .step shows with "fast".
  2. Callback. When done, look for the next sibling.
  3. Recurse. The same function runs for the next div.
  4. Stop. When there is no next sibling, the chain ends.

Edge Cases & Pitfalls

Check these before revealing elements in real pages.

important

!important wins

Stylesheets with display: none !important block .show(). Use class toggles instead.

display

Not always block

After .hide(), .show() restores the saved mode — inline stays inline.

callback

Callback per element

Animating three nodes fires complete three times — not once for the whole set.

responsive

Viewport-dependent display

If CSS changes display by breakpoint, inline show/hide can fight responsive layouts.

fx

jQuery.fx.off

When true, animated .show("slow") becomes instant.

Browser Support

.show() is a core jQuery method (since 1.0). It needs a browser DOM with jQuery loaded.

✓ jQuery 1.0+ · Browsers only

jQuery .show()

Works in Chrome, Firefox, Safari, Edge, and other browsers with jQuery. Not for Node.js without a DOM.

100% Browser support
Google Chrome All versions · Desktop & Mobile
Full support
Mozilla Firefox All versions · Desktop & Mobile
Full support
Apple Safari All versions · macOS & iOS
Full support
Microsoft Edge All versions · Chromium & Legacy
Full support
Internet Explorer IE 6+ · Legacy environments
Full support
Opera All modern versions
Full support
.show() Browsers

Bottom line: Use .show() in the browser to reveal elements and restore saved display. Pair with .hide() and .toggle() for visibility UIs.

Performance Notes

ApproachCostBest for
.show()LowInstant reveal
.show(duration)HigherAnimated panels / feedback
Many animated nodesHighestAvoid large simultaneous shows

Instant .show() is cheap. Animating many elements at once can hurt performance — prefer classes for bulk visibility when possible.

Key Takeaways

  • Role: display matched elements, restoring saved display.
  • Instant vs animated: no args → instant; duration → width/height/opacity.
  • Pair: use with .hide() and .toggle().
  • Limit: cannot beat display: none !important.

One line: $(sel).show() reveals elements and restores their saved display — optionally with animation.

Frequently Asked Questions

.show() displays matched elements. With no arguments it is instant and restores the display value saved by .hide() (or a sensible default). With a duration or options it animates width, height, and opacity. Returns the jQuery collection. Available since jQuery 1.0.
.css('display', 'block') always forces block. .show() restores the saved display — so an inline span becomes inline again. Prefer .show() after .hide() for correct layout.
.hide() sets display: none and saves the old display. .show() reverses that. Pair them for menus, modals, and panels.
Yes. Pass milliseconds, 'slow' (600ms), or 'fast' (200ms). You can also pass easing (1.4.3+), an options object, and a complete callback (once per matched element).
No. Prefer class toggles with .addClass() / .removeClass() / .toggleClass(). Forcing style with !important overwrites the style attribute and is usually a last resort.
Set jQuery.fx.off = true. All effects, including .show(), then run with zero duration. Useful for tests or reduced motion.

Next: size()

Learn the legacy length helper and what to use instead.

size() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

9 people found this page helpful