jQuery Hide Show Effect

jQuery used to provide a various kind of effects like Hide, Show, Slide, Fade, Animate and toggle effects.

jQuery hide() method hide the matched elements. and jQuery show() method display the matched elements.


$(selector).show();        // This syntax does not accept any arguments.
$(selector).show( [duration], [callback] );
$(selector).hide();        // This syntax does not accept any arguments.
$(selector).hide( [duration], [callback] );


  • duration default: 400 Accept string or number that determining how long animation will run. For example predefined duration ("slow", "normal", "fast"), or number of milliseconds to run the animation (3000, 1000).

  • Example. "slow", "normal", "fast", 3000 (milliseconds), 1000 (milliseconds).

  • callback Optional. A function to call once the animation is complete.


<!DOCTYPE html>
  <title>jQuery hide() show() function</title>
  <script src="jquery-latest.min.js"></script>
    $(document).ready(function() {
      $("#show").click(function () {
      $("#hide").click(function () {
  <style type="text/css">
    p {
      background-color: #99FFFF;
      font-size: 16px;
  <button id="btn1">Hide Paragraph</button> 
  <button id="btn2">Show Paragraph</button> 
  <p>This paragraph will be hide/show animated.</p> 

Run it...   »

Example Result :

Here are all jQuery effects references, see all jQuery effects references.