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.
- position.coords: The coordinates object that has all the information of the current location.
- position.timestamp: It represents the DOMTimeStamp which represents the time when the location is obtained.
Usage: Methods like getCurrentPosition() or watchPosition() are used to pass a callback to a function and then access the position property.
Before Click on the button:
After Click on the button:
Supported Browsers: The browser supported by DOM Geolocation position property are listed below:
- Google Chrome 5.0
- Internet Explorer 9.0
- Firefox 3.5
- Opera 16.0
- Safari 5.0
- HTML | DOM Geolocation coordinates Property
- HTML | Navigator geolocation Property
- HTML | Geolocation
- How to get city name by using geolocation ?
- HTML | DOM Style position Property
- HTML | DOM Progress position Property
- CSS | list-style-position Property
- CSS | background-position Property
- CSS | object-position Property
- CSS font-variant-position Property
- Retrieve the position (X,Y) of an element using HTML
- HTML | DOM lang Property
- HTML | DOM Style backgroundClip Property
- HTML | DOM Style borderTop Property
- HTML | DOM Meter max Property
- HTML | DOM Input Hidden value Property
- HTML | DOM Textarea autofocus Property
- HTML | DOM Style columnGap Property
- HTML | DOM Input Time autofocus Property
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.