The hide() is an inbuilt method in jQuery used to hide the selected element.
$(selector).hide(duration, easing, call_function);
Here selector is the selected element.
Parameter: It accepts three parameters which are specified below-
- duration: It specifies the speed of the hide effect.
- easing: It specifies the speed of the element at different point of animation.
- call_function: This is call back function to be executed after hide operation.
Return Value: It does not return any value.
In the below code, no parameter is used to pass to this method.
Before clicking on “Click me!” button-
After clicking on “Click me!” button-
In the below code, parameter is passed to this method.
Before clicking on the “Click to Hide” button-
After clicking on the “Click to Hide” button-
- jQuery | Hide/Show, Toggle and Fading methods with Examples
- How to hide a div when the user clicks outside of it using jQuery?
- How to hide div element after few seconds in jQuery ?
- How to Display/Hide functions using aria-hidden attribute in jQuery ?
- How to Hide an HTML Element in Mobile View using jQuery ?
- How to show/hide div element depending multiple values using Bootstrap and jQuery ?
- Hide or show elements in HTML using display property
- How to display icon next to show/hide text on button?
- p5.js | hide() Function
- How to Show and Hide div elements using radio buttons?
- How to Show and Hide div elements using Checkboxes ?
- How to hide scroll bar for inactivity?
- How to hide “Image not found” icon when source image is not found?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.