You are here: Reference > JavaScript > client-side > HTML DOM > properties > URL (document, XMLDocument)
URL property (document, XMLDocument)
Specifies or returns the location of the current document.
Syntax:
You can find the related objects in the Supported by objects section below.
This property is read/write.
Possible values:
String that represents the URL of the document.
Default: this property has no default value.
Example HTML code 1:
This example illustrates the use of the URL property:
|
||||
<head> <script type="text/javascript"> function GetDocURL () { alert ("The URL of the document: " + document.URL); } </script> </head> <body> <button onclick="GetDocURL ();">Get the location of the document!</button> </body> |
||||
|
||||
Did you find this example helpful?
|
Supported by objects:
Related pages:
External links:
User Contributed Comments