Location href attribute
Definition and Usage
href attribute is a readable and writable string sets or returns the complete URL of the document currently displayed.
grammar
location.href
Browser Support
All major browsers support href attribute
Examples
Examples
Returns the full URL (this page):
<script>
document.write(location.href);
</script>
document.write(location.href);
</script>
Examples of the above output:
try it"
Location Object