The hide() function is an inbuilt function which is used to hide the current element. Essentially display: none is used for this style.
This function requires p5.dom library. So add the following line in the head section of the index.html file.
Parameters: This function does not accepts any parameters.
Below examples illustrate the hide() function in p5.js:
Example 1: This example uses hide() function to hide the div element.
Example 2: This example uses hide() and show() function to display the div element.
- AngularJS | ng-hide Directive
- jQuery | hide() with Examples
- How to Show and Hide div elements using Checkboxes ?
- How to hide div element after few seconds in jQuery ?
- How to hide elements in responsive layout using CSS ?
- How to hide a div when the user clicks outside of it using jQuery?
- How to hide an element when printing a web page using CSS?
- How to Show and Hide div elements using radio buttons?
- How to display icon next to show/hide text on button?
- Hide or show elements in HTML using display property
- Image Replacement in Bootstrap using text-hide Class
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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.