Javascript Reference - HTML DOM URL Property








The URL property returns the full URL of the current document.

Syntax

document.URL

Browser Support

URL Yes Yes Yes Yes Yes

Example

The following code shows how to get the full URL of the current document.


<!DOCTYPE html>
<html>
<body>
<script>
document.write(document.URL);
</script>

</body>
</html>

The code above is rendered as follows: