Document: documentURI property
{{ApiRef("DOM")}}
The documentURI read-only property of the
{{domxref("Document")}}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
{{EmbedLiveSample("Examples", "100%", 100)}}
Specifications
{{Specifications}}
Browser compatibility
{{Compat}}
See also
- The
{{domxref("document.URL")}}URL property which returns the same value.