Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

jQuery hide() method

jQuery hide() method

jQuery effects methods jQuery effects methods

Example

Hide all elements

element:

$

(

"

button

"

)

.

click

(

function

(

)

{

$

(

"

p

"

)

.

hide

(

)

;

}

)

;

Try it »


Definition and Usage

The hide() method hides the selected elements.

**Tip:** This is similar to the CSS property display:none.

**Note:** Hidden elements will not be fully displayed (they no longer affect the page's layout).

**Tip:** To show hidden elements, see the show() method. show() method.

Syntax

$(

selector

).hide(

speed,easing,callback

)

Parameters Description
speed Optional. Specifies the speed of the hiding effect.

Possible values:

  • Millisecond
  • "slow"
  • "fast"
  • | | *easing* | Optional. Specifies the speed of the element at different points in the animation. The default is "swing".

    Possible values:

    **Tip:** More easing functions are available in extension plugins. | | *callback* | Optional. A function to be executed after the hide() method finishes.

    To learn more about callback, please visit our jQuery Callback chapter on callbacks.

    |

    More examples

    hide() - Using the speed parameter
    How to use the speed parameter when hiding/showing elements.

    hide() - Using the callback parameter
    How to use the callback parameter when hiding/showing elements.


    jQuery effects methods jQuery effects methods