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

Update compatibility data on GitHub
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic supportChrome Full support YesEdge ? Firefox Full support YesIE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile ? Firefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android ?
Read-only behaviorChrome Full support 43Edge ? Firefox Full support YesIE No support NoOpera Full support 30Safari No support NoWebView Android Full support 43Chrome Android Full support 43Edge Mobile ? Firefox Android Full support YesOpera Android Full support 30Safari iOS No support NoSamsung Internet Android ?


Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown

Document Tags and Contributors

Last updated by: fscholz,