Location href Property
Location object
Definition and Usage
The href property is a read-write string that sets or returns the complete URL of the currently displayed document.
Syntax
location.href
Browser support





All major browsers support the href property.
Example
Example
Return the complete URL (current page):
The example above produces the following output:
Try it »
Location object