The URL
property returns the full URL of the current document.
document.URL
URL |
Yes | Yes | Yes | Yes | Yes |
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: