Saturday, May 9, 2026
HomeLanguagesJavascriptHTML DOM Document hidden Property

HTML DOM Document hidden Property

The Document hidden property returns a Boolean value indicating if the page is considered hidden or not. This is a read-only property.

Syntax:

let bool = document.hidden;

Return Value: This property returns a Boolean Value.

  • true if the page is considered hidden.
  • false if the page is not considered hidden

Example: This example shows how to use this property to check whether the page is hidden or not.

HTML




<!DOCTYPE html>
<html>
   
<body>
    <h1>neveropen</h1>
 
    <button onclick="get()">
        Check
    </button>
     
    <script type="text/javascript">
        function get() {
            alert(document.hidden);
        }
    </script>
</body>
   
</html>


Output:

 

Supported Browsers:

  • Google Chrome 33
  • Edge 12
  • Internet Explorer 10
  • Firefox 18
  • Opera 12.1
  • Safari 7
Whether you’re preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, neveropen Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we’ve already empowered, and we’re here to do the same for you. Don’t miss out – check it out now!
RELATED ARTICLES

5 COMMENTS

Most Popular

Dominic
32514 POSTS0 COMMENTS
Milvus
131 POSTS0 COMMENTS
Nango Kala
6892 POSTS0 COMMENTS
Nicole Veronica
12012 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12107 POSTS0 COMMENTS
Shaida Kate Naidoo
7016 POSTS0 COMMENTS
Ted Musemwa
7262 POSTS0 COMMENTS
Thapelo Manthata
6975 POSTS0 COMMENTS
Umr Jansen
6963 POSTS0 COMMENTS