jQuery Effect show() Method (original) (raw)

Last Updated : 18 Nov, 2022

The show() Method in jQuery is used to display the hidden and selected elements.

Note: This method display the hidden elements which are using CSS display: none property. The elements are not visible whose visibility is hidden.

Syntax:

$(selector).show( speed, easing, callback )

**Parameters:**This method accepts three parameters as mentioned above and described below:

Below examples illustrate the show() method in jQuery:
Example 1: This example showing display: none content with given speed.

HTML `

jQuery Effect show() Method
<style>
    #Outer {
        border: 1px solid black;
        padding-top: 40px;
        height: 140px;
        background: green;
        display: none;
    }
</style>

<script src=

"" title="undefined" rel="noopener noreferrer">https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js">

<div id="Outer">
    <h1 style="color:white;">
        GeeksForGeeks
    </h1>
</div><br>

<button id="btn">
    Show
</button>

<!-- Script to show display:none content -->
<script>
    $(document).ready(function () {
        $("#btn").click(function () {
            $("#Outer").show(1000);
        });
    });
</script>

`

Output:

Example 2: This example showing display: none content with swing easing value.

HTML `

jQuery Effect show() Method
<style>
    #Outer {
        border: 1px solid black;
        padding-top: 40px;
        height: 140px;
        background: green;
        display: none;
    }
</style>
<script src=

"" title="undefined" rel="noopener noreferrer">https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js">

<div id="Outer">
    <h1 style="color:white;">
        GeeksForGeeks
    </h1>
</div><br>
<button id="btn">
    Show
</button>

<!-- Script to show display: none content
        with swing easing -->
<script>
    $(document).ready(function () {
        $("#btn").click(function () {
            $("#Outer").show("swing");
        });
    });
</script>

`

Output: