THE WORLD'S LARGEST WEB DEVELOPER SITE

HTML DOM documentURI Property

❮ Document Object

Example

Get the location URI of the document:

var x = document.documentURI;
Try it Yourself »

Definition and Usage

The documentURI property sets or returns the location of a document.

If the document was created by the DocumentImplementation object, or if it is undefined, the return value is null.

Tip: Unlike the document.URL property, the documentURI property can be used on any document types, whereas URL can only be used on HTML documents.


Browser Support

Property
documentURI Yes Not supported Yes Yes Yes

Syntax

Return the documentURI property:

document.documentURI

Set the documentURI property:

document.documentURI = locationURI

Technical Details

Return Value: A String, representing the URI of the document
DOM Version Core Level 3 Document Object

❮ Document Object