coderef

<geolocation>Limited availability

The &#x3C;geolocation> HTML element represents a button that, upon activation, prompts the user to choose whether to grant the page access to geolocation data.

Not yet supported in all major browsers — check the table and provide a fallback.

Browser support

DesktopChrome
1–143Not supported
144+Supportedsince Jan 13, 2026
Current: 155
Edge
12–143Not supported
144+Supportedsince Jan 21, 2026
Current: 154
Firefox
✕Not supportedup to 157
Current: 157
Safari
✕Not supportedup to 27
Current: 27
MobileChrome Android
18–143Not supported
144+Supportedsince Jan 13, 2026
Current: 155
Firefox Android
✕Not supportedup to 157
Current: 157
Safari iOS
✕Not supportedup to 27
Current: 27

How to use

Not supported in Firefox, Safari, Firefox Android, Safari iOS. Use feature detection below and provide a fallback (or a polyfill) for those browsers.

Example

Full syntax and examples are on MDN: HTMLGeolocationElement.

Feature detection

JS · check before using
if ("HTMLGeolocationElement" in globalThis) {
  // HTMLGeolocationElement is available
} else {
  // load a polyfill or use a fallback
}

Sub-features

Support for each part of the feature (15). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
HTMLGeolocationElement144144✕✕144✕✕
HTMLGeolocationElement.autolocate144144✕✕144✕✕
HTMLGeolocationElement.error144144✕✕144✕✕
HTMLGeolocationElement.invalidReason144144✕✕144✕✕
HTMLGeolocationElement.isValid144144✕✕144✕✕
HTMLGeolocationElement.location_event144144✕✕144✕✕
HTMLGeolocationElement.permissionStatus144144✕✕144✕✕
HTMLGeolocationElement.position144144✕✕144✕✕
HTMLGeolocationElement.promptaction_event144144✕✕144✕✕
HTMLGeolocationElement.promptdismiss_event144144✕✕144✕✕
HTMLGeolocationElement.validationstatuschange_event144144✕✕144✕✕
HTMLGeolocationElement.watch144144✕✕144✕✕
geolocation144144✕✕144✕✕
geolocation.autolocate144144✕✕144✕✕
geolocation.watch144144✕✕144✕✕