jQuery .show() Method

Beginner
⏱️ 11 min read
📚 Updated: Jul 2026
🎯 5 Examples
🚀 5 Try-it labs
Visibility & effects

What You’ll Learn

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

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.

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.

📝 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
  }
} )

Easing form — since 1.4.3

jQuery
.show( duration [, easing ] [, complete ] )

.show( 600, "linear", function() {
  console.log( "Visible!" );
} );

⚡ Quick Reference

GoalCode
Show instantly$("#panel").show()
Show slowly (600 ms)$("#panel").show("slow")
Show quickly (200 ms)$("#panel").show("fast")
Custom duration$("#panel").show(400)
Run code after show$("#panel").show(500, fn)
Hide again$("#panel").hide()

📋 .show() vs .hide() vs .toggle() vs .css()

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

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
Try It Yourself

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.

jQuery
// CSS: p { display: none; }  (or hidden via .hide())

$( "button" ).on( "click", function() {
  $( "p" ).show( "slow" );
} );
Try It Yourself

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.

jQuery
$( "#showr" ).on( "click", function() {
  $( "div" ).first().show( "fast", function showNext() {
    $( this ).next( "div" ).show( "fast", showNext );
  } );
} );

$( "#hidr" ).on( "click", function() {
  $( "div" ).hide( 1000 );
} );
Try It Yourself

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.

jQuery
$( "#clickme" ).on( "click", function() {
  $( "#book" ).show( "slow", function() {
    // Animation complete.
  } );
} );
Try It Yourself

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.

jQuery
$( "form" ).on( "submit", function( event ) {
  if ( $( "input" ).val() === "yes" ) {
    $( "p" ).show( 4000, function() {
      $( this ).text( "Ok, DONE! (now showing)" );
    } );
  }
  $( "span,div" ).hide( "fast" );
  event.preventDefault();
} );
Try It Yourself

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" ).

🚀 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.

📝 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.

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 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() Universal

Bottom line: Default choice when revealing elements previously hidden with .hide() or CSS display none.

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().

💡 Best Practices

✅ Do

  • Pair .show() with .hide() so display values restore correctly
  • Use sequential callbacks for staggered list or menu reveals
  • Pass a complete callback to focus inputs after panels open
  • Use instant .show() when content should appear immediately after Ajax
  • Prefer CSS class toggles when !important rules block jQuery effects

❌ Don’t

  • Use .css("display","block") when the element was originally inline or flex
  • Expect .show() to override display: none !important in CSS
  • Animate hundreds of elements simultaneously without profiling performance
  • Forget accessibility — manage aria-hidden alongside visibility changes
  • Confuse .show() with inserting new DOM nodes — it only reveals existing ones

Key Takeaways

Knowledge Unlocked

Six things to remember about .show()

The visibility method that restores saved display from .hide().

6
Core concepts
🎬 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.

Next: jQuery .size() Method

Count matched elements (legacy API) and migrate cleanly to .length.

.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.

6 people found this page helpful