The visibility property is used to hide or show the content of HTML elements. The visibility property specifies that the element is currently visible on the page. The ‘hidden’ value can be used to hide the element. This hides the element but does not remove the space taken by the element, unlike the display property.
element.style.visibility = 'hidden'; element.style.visibility = 'visible';
- Clicking the Hide button:
- Clicking the Show button:
Note: Here after clicking the hide button the element will become invisible and left the space blank.
- Hide or show elements in HTML using display property
- jQuery | Hide/Show, Toggle and Fading methods with Examples
- HTML | DOM Style visibility Property
- CSS | visibility Property
- CSS | backface-visibility Property
- Visibility of elements in bootstrap with Examples
- AngularJS | ng-show Directive
- jQuery | Effect show() Method
- AngularJS | ng-hide Directive
- jQuery | hide() with Examples
- How to hide div element after few seconds in jQuery ?
- How to hide an element when printing a web page using CSS?
- How to hide a div when the user clicks outside of it using jQuery?
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.