GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • MDN
  • HTML: Markup language
  • Elements
  • Global attributes
  • Attributes
  • See all…
  • Responsive images
  • HTML cheatsheet
  • Date & time formats
  • See all…
  • SVG
  • MathML
  • XML
  • CSS: Styling language

This view

  • Original page
  • New address

GeezerVison is showing developer.mozilla.org — HTMLGeolocationElement: HTMLGeolocationElement() constructor - Web APIs | MDN

HTMLGeolocationElement: HTMLGeolocationElement() constructor

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

The HTMLGeolocationElement() constructor creates a new HTMLGeolocationElement object instance.

Syntax

js
new HTMLGeolocationElement()

Parameters

None.

Return value

A new HTMLGeolocationElement object instance, if used internally by the browser.

Developers cannot use the HTMLGeolocationElement() constructor directly to create a new HTMLGeolocationElement instance: attempting to do so results in an "illegal constructor" error.

Examples

Creating a new HTMLGeolocationElement instance programmatically

To programmatically create a new HTMLGeolocationElement instance, instead of trying to use the constructor directly, you would create a new <geolocation> element instance using Document.createElement():

js
const geo = document.createElement("geolocation");

You can then use it by appending it to the DOM:

js
document.body.append(geo);

Specifications

This feature does not appear to be defined in any specification.

Browser compatibility

See also

  • <geolocation> element

Help improve MDN

Learn how to contribute

This page was last modified on Feb 19, 2026 by MDN contributors.

View this page on GitHub • Report a problem with this content
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.