jQuery hide and show methods are used to give special effects to the elements on hiding, showing, changing style properties. These methods can be useful in building an interactive user interface.
jQuery Hide and Show Effects:
jQuery Hide Method:
jQuery hide() method is used to hide the selected HTML element.
Syntax:
$(selector).hide();
$(selector).hide(speed, callback);
In the above syntax:
Speed is an optional parameter that specifies the speed of the delay and its possible values are slow, fast and milliseconds.
The callback is also an optional parameter that specifies the function to be called after completion of hide() effect.
In the following example, we are hiding the selected <h2> element.
Example:
When the user clicks on the <h2> element it will get hide.
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.Ok