HTML DOM Navigator geolocation Property Last Updated : 14 Jun, 2023 Comments Improve Suggest changes Like Article Like Report The Navigator geolocation property is used to return a geolocation object by the browser which can be used to locate a user's position. It is a read-only property and is only available on the approval of the user since it can compromise the user's privacy. Syntax: navigator.geolocation Below program illustrates the Navigator geolocation Property :Checking the user's geolocation. HTML <!DOCTYPE html> <html> <head> <title>Navigator geolocation Property in HTML</title> <style> h1 { color: green; } h2 { font-family: Impact; } body { text-align: center; } </style> </head> <body> <h1>GeeksforGeeks</h1> <h2>Navigator geolocation Property</h2> <p>For checking your coordinates, double click the "Get Coordinates" button : </p> <button ondblclick="getCoordinates()">Get Coordinates</button> <p id="loc"></p> <script> var x = document.getElementById("loc"); function getCoordinates() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(showcoordinates); } else { x.innerHTML = "The browser doesn't support Geolocation."; } } function showcoordinates(myposition) { x.innerHTML = "Your Latitude is: " + myposition.coords.latitude + "<br>Your Longitude is: " + myposition.coords.longitude; } </script> </body> </html> Output: Before clicking the button: After clicking the button: Supported Browsers: The browser supported by Navigator geolocation are listed below: Google Chrome 5Edge 12Internet Explorer 9Firefox 3.5Opera 10.6Safari 5 Comment More infoAdvertise with us Next Article HTML DOM Navigator geolocation Property S Shubrodeep Banerjee Follow Improve Article Tags : Web Technologies HTML HTML-Property Similar Reads HTML DOM Geolocation position Property The Geolocation position property in HTML DOM is used to return the position of a device on Earth. The returned Coordinates object could be used for various purposes including navigation and tracking the position of the device. Return Value: position.coords: The coordinates object that has all the i 2 min read HTML DOM Geolocation coords.latitude Property In this article, we will discuss the Geolocation latitude property. Geolocation in HTML is used to get the geographical position of a user. The getCurrentPosition() method, in this geolocation, returns an object on success. coords.latitude: This property will return the latitude as a decimal number. 1 min read HTML DOM Geolocation coords.longitude Property In this article, we will discuss the Geolocation longitude property. Geolocation in HTML  is used to get the geographical position of a user. The getCurrentPosition() method in this geolocation returns an object on success. coords.longitude: This property will return the longitude as a decimal numb 1 min read HTML DOM Geolocation timestamp Property In this article, we will discuss the Geolocation timestamp property. Geolocation in HTML is used to get the geographical position of a user. The getCurrentPosition() method, in this geolocation, returns an object on success. Syntax: timestamp Return Value:- This geolocation property returns an objec 1 min read HTML DOM Window navigator Property The HTML DOM Window navigator property is used to return a Navigator object. The navigator object contains information about the browser. This Navigator object contains methods and properties of the application which is run the script. Syntax: var nav = window.navigator; Return Value: A Navigator Ob 1 min read Like