Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

HTML DOM Window navigator Property

  • Last Updated : 27 Jul, 2020

HTML DOM Window navigator property is used to return a Navigator object. This Navigator object  contains methods and properties of the application which is run the script.

Syntax:

Hey geek! The constant emerging technologies in the world of web development always keeps the excitement for this subject through the roof. But before you tackle the big projects, we suggest you start by learning the basics. Kickstart your web development journey by learning JS concepts with our JavaScript Course. Now at it's lowest price ever!

var nav = window.navigator;

Return Value: A Navigator Object.

Example: This example shows how to get the Navigator Object of the document using this property.



HTML




<!DOCTYPE HTML>
<html>
  
<body style="text-align:center;">
    <h1 style="color:green;">
        GeeksforGeeks
    </h1>
  
    <p>
        HTML | window navigator property
    </p>
  
  
    <button onclick="Geeks()">
        Click Here
    </button>
  
    <script>
        function Geeks() {
            console.log(window.navigator);
        }
    </script>
</body>
  
</html>

Output:

  • Before Clicking the Button:

  • After Clicking the Button: In the console, the navigator object can be seen.

Supported Browsers:

  • Google Chrome
  • Edge
  • Firefox
  • Safari
  • Opera
My Personal Notes arrow_drop_up
Recommended Articles
Page :