The documentURI property of the Document interface returns the document location as a string.

As originally defined in DOM3 this attribute read/write. In the modern DOM Standard it is read only.


var string = document.documentURI;


HTML documents have a document.URL property which returns the same value. Unlike URL, documentURI is available on all types of documents.


Specification Status Comment
The definition of 'documentURI' in that specification.
Living Standard  
Document Object Model (DOM) Level 3 Core Specification
The definition of 'documentURI' in that specification.
Obsolete Initial definition

Browser compatibility

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Read-write behavior (Yes) (Yes) (Yes) ? (Yes)
Readonly behavior 43.0 (Yes) No support ? No support
Feature Android Webview Chrome for Android Firefox Mobile (Gecko) Firefox OS IE Mobile Opera Mobile Safari Mobile
Read-write behavior ? (Yes) ? ? ? ? ?
Readonly behavior (Yes) 43.0 ? ? ? ? ?

Document Tags and Contributors

 Last updated by: jpmedley,