Easy Tutorial
❮ Css Css Jquery Intro ❯

jQuery hide() Method

jQuery Effects Methods

Example

Hide all <p> elements:

$("button").click(function(){
    $("p").hide();
});

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 completely displayed (no longer affect the layout of the page).

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

Syntax

Parameter Description
speed Optional. Specifies the speed of the hide effect. Possible values: milliseconds<br> "slow"<br> "fast"
easing Optional. Specifies the speed of the element at different points of the animation. The default value is "swing". Possible values: "swing" - moves slow at the start/end, fast in the middle<br> "linear" - moves at a constant speed. Tip: More easing functions are available in extensions.
callback Optional. A function to be executed after the hide() method completes. For more information about callback, visit our jQuery Callback chapter.

More Examples

hide() - Using speed parameter

hide() - Using callback parameter


jQuery Effects Methods

❮ Css Css Jquery Intro ❯