YouTip LogoYouTip

Prop Loc Href

hljs.highlightAll();

Location href Property |


Definition and Usage

The href property returns the entire URL of the current page.

Syntax

location.href

Return Value

A string representing the full URL of the current page.

Example

This example displays the full URL of the current page in an alert box:

<script>
document.write("Full URL: " + location.href);
</script>

Related Pages


← Prop Loc PathnameProp Loc Hostname β†’