Skip to content
Related Articles
Open in App
Not now

Related Articles

HTML DOM Geolocation coords.altitudeAccuracy Property

Improve Article
Save Article
  • Last Updated : 23 Nov, 2021
Improve Article
Save Article

In this article, we will discuss the Geolocation altitudeAccuracy 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.altitudeAccuracy: This property will return the accuracy position if available in meters above sea level.



Example: The following HTML code will return the altitudeAccuracy property.


<!DOCTYPE html>
    <meta charset="utf-8">
    <meta name="viewport" 
    <h2 style="color:green">GeeksforGeeks</h2>
    <p><b> Displaying AltitudeAccuracy</b></p>
    <button onclick="getlocation()"> Click Me </button>
    <p id="paraID"></p>
      var variable1 = document.getElementById("paraID");
      function getlocation() {
      function showLoc(pos) {
          variable1.innerHTML = "AltitudeAccuracy: "
                             + pos.coords.altitudeAccuracy;


Supported Browsers:

  • Google Chrome 5.0
  • Internet Explorer 9.0
  • Firefox 3.5
  • Opera 16.0
  • Safari 5.0
My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!