HTML | DOM documentURI Property
The documentURI property in HTML DOM used to set or return the location of a document. The return value is null If the document was created by the DocumentImplementation object or undefined.
The documentURI property can be used on any document types.
Syntax:
- Return the documentURI property:
document.documentURI
- Set the documentURI property:
document.documentURI = locationURI
Example: Return the documentURI property:
<!DOCTYPE html> <html> <body> <center> <h1 style="color:green">GeeksforGeeks</h1> <h2>HTML DOM documentURI Property</h2> <button onclick="GFGfun()">Click Me!</button> <p id="demo"></p> </center> <script> function GFGfun() { var v = document.documentURI; document.getElementById("demo").innerHTML = v; } </script> </body> </html> |
Output:
Before:

After:

Supported Browsers: The browsers supported by HTML DOM documentURI Property are listed below:
- Google Chrome
- Firefox
- Apple Safari
- Opera
Recommended Posts:
- HTML | DOM Map name Property
- HTML | DOM Bdo dir Property
- HTML | DOM value Property
- HTML | DOM URL Property
- HTML | DOM specified Property
- HTML | DOM li value Property
- HTML | DOM id Property
- HTML | DOM name Property
- HTML | DOM dir Property
- HTML | DOM scrollHeight Property
- HTML | DOM scrollTop Property
- HTML | DOM Output value Property
- HTML | DOM Area alt Property
- HTML | DOM scrollWidth Property
- HTML | DOM Video src Property
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



