jQuery hide() method
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: |
Possible values:
- "swing" - Moves slowly at the beginning/end, and faster in the middle
- "linear" - Moves at a constant speed
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