HTML Geolocation
Get user's location with permission.
David Miller
January 15, 2026
0.4k9
Geolocation API finds user location.
## Example
```html
<script>
navigator.geolocation.getCurrentPosition(
pos => alert(pos.coords.latitude),
err => alert("Permission denied")
);
</script>
```
## Important
Browser always asks permission.
#HTML#APIs