HTML DOM Document baseURI

Example

Get the baseURI of the document:

let base = document.baseURI;
Try it Yourself »

Description

The baseURI property returns the base URI of the document.

The baseURI property is read-only.


Syntax

document.baseURI

Return Value

Type Description
StringThe Base URI of the document.

Browser Support

document.baseURI is a DOM Level 4 (2015) feature.

It is supported in all modern browsers:

Chrome Edge Firefox Safari Opera
Yes Yes Yes Yes Yes

document.baseURI is not supported in Internet Explorer 11 (or earlier).


Copyright 1999-2023 by Refsnes Data. All Rights Reserved.