Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM documentURI property

HTML DOM documentURI property

Document Object Reference Document Object

Example

Get the local URI of the document:

document.documentURI;

Output result:

http://www.w3cschool.cc/jsref/prop-document-documenturi.html

Try it »


Definition and Usage

The documentURI property can set or return the location of the document.

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


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All browsers except Internet Explorer support the documentURI property.


Syntax

Set the documentURI of the document:

document.documentURI=

locationURI

Return the documentURI:

document.documentURI

Technical Details

Return Value: String representing the URI of the document.
DOM version Core Level 3 Document Object

Document Object Reference Document Object