URL property
Sets or gets the URL for the current document.
Syntax
| JavaScript | |
|---|
Property values
Type: String
the URL.
Standards information
- Document Object Model (DOM) Level 1 Specification, Section 2.4
Remarks
The URL property is case-sensitive.
This property is an alias for the location.href property on the window.
Examples
This example function returns the URL property of the current document.
function getURL() { return document.URL; }
See also
- document
- Reference
- urn
- URLUnencoded
Show: