HTMLGeolocationElement: isValid property

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The isValid read-only property of the HTMLGeolocationElement interface returns a boolean value indicating whether the associated <geolocation> element is valid or invalid (blocked).

When a blocker is active on a <geolocation> element, it is prevented from functioning (invalid), either temporarily or permanently, depending on the reason.

You can return the reason why it is invalid via the HTMLGeolocationElement.invalidReason property — see that page for a full list of possible reasons.

Value

A boolean value:

  • If true, the <geolocation> element is valid and functional, meaning that it can be used to request location data.
  • If false, the <geolocation> element is invalid and non-functional, meaning that it can't be used to request location data.

Defaults to false.

Examples

Basic usage

html
<geolocation></geolocation>
js
const geo = document.querySelector("geolocation");
console.log(geo.isValid);
// true, provided the `<geolocation>` element is not blocked in some way

See the HTMLGeolocationElement.invalidReason page for a more complete example involving isValid.

Specifications

Specification
The HTML Geolocation Element
# dom-inpagepermissionmixin-isvalid

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
isValid
Experimental
Chrome – Full support
Chrome 144 (Release date: 2026-01-13)
footnote Full support
Edge – Full support
Edge 144 (Release date: 2026-01-21)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 128 (Release date: 2026-02-26)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – Full support
Chrome Android 144 (Release date: 2026-01-13)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 95 (Release date: 2026-02-11)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – No support
Samsung Internet
footnote No support
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – No support
WebView on iOS
footnote No support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
Experimental. Expect behavior to change in the future.

See also