Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App

Related Articles

HTML DOM Geolocation coords.accuracy Property

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

In this article, we will discuss the Geolocation accuracy 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.

HTML Geolocation coords.accuracy Property: This property will return the accuracy of the location as a decimal number



Example: The following HTML program returns the accuracy.


<!DOCTYPE html>
    <h2 style="color:green">
<p><b>Displaying Accuracy</b></p>
    <button onclick="getlocation()">
        Click Me
    <p id="paraID"></p>
        var variable1 = document.getElementById("paraID");
        function getlocation() {
        function showLoc(pos) {
            variable1.innerHTML = "Accuracy: "
                + pos.coords.accuracy;


Supported Browsers: 

  • Google Chrome 5 and above
  • Edge 12 and above
  • Internet Explorer 9.0 and above
  • Firefox 3.5 and above 
  • Opera 16.0 and above
  • Safari 5 and above
My Personal Notes arrow_drop_up
Last Updated : 01 Jun, 2022
Like Article
Save Article
Similar Reads
Related Tutorials