Wednesday, July 3, 2024
HomeLanguagesJavascriptHTML DOM window document Property

HTML DOM window document Property

The HTML DOM window document returns a reference to the document contained in the current window.

Syntax:

doc = window.document;

Return Value: This property returns a reference to the document.

Example: In this example, we will get the title of the document using that document reference.

html




<title>Window document property</title>
  
<body style="text-align:center;">
    <h1 style="color:green;">
        neveropen
    </h1>
    <p>
        HTML | window document property
    </p>
    <button onclick="Geeks()">
        Click Here
    </button>
    <p id="a">
    </p>
    <script>
        var a = document.getElementById("a");
        function Geeks() {
            console.log(window.document)
            a.innerHTML=window.document.title;
        }
    </script>
</body>


Output:

 

We have a complete list of HTML DOM methods, to check those please go through this HTML DOM Object Complete reference article.

Supported Browsers:

  • Google Chrome 1
  • Edge 12
  • Firefox 1
  • Safari 1
  • Opera 12.1
  • Internet Explorer 4

We have a Cheat Sheet on Javascript where we covered all the important topics of Javascript to check those please go through Javascript Cheat Sheet-A Basic guide to JavaScript.

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!

Shaida Kate Naidoo
am passionate about learning the latest technologies available to developers in either a Front End or Back End capacity. I enjoy creating applications that are well designed and responsive, in addition to being user friendly. I thrive in fast paced environments. With a diverse educational and work experience background, I excel at collaborating with teams both local and international. A versatile developer with interests in Software Development and Software Engineering. I consider myself to be adaptable and a self motivated learner. I am interested in new programming technologies, and continuous self improvement.
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments