web api instance property
Document: documentURI property
The documentURI read-only property of the
Document interface returns the document location as a string.
Value
A string.
Examples
JavaScript
document.getElementById("url").textContent = document.documentURI;
HTML
<p id="urlText">
URL:<br />
<span id="url">URL goes here</span>
</p>
Result
Interactive exampleOpen the canonical MDN source to run this embedded demo.
Specifications
SpecificationsStandards references are available on the canonical MDN page.
Browser compatibility
Browser compatibilityCompatibility data is available on the canonical MDN page.
See also
- The
URLproperty which returns the same value.