HTML DOM URL Property
The DOM URL property In HTML, the window.location.href
is used to provide the full web address of the current webpage. This address includes the initial part of the web protocol, like "http://".
Syntax:
document.URL
Return Value: The result is a piece of text that shows the complete web address of the document.
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body style="text-align:center;">
<h1> Propertutorials </h1>
<h2> HTML DOM URL Property </h2>
<p id="ppt"> propertutorials URL: <span id="PPT"> https://www.propertutorials.com/ </span>
</p>
<script>
document.getElementById("PPT").textContent = document.URL;
</script>
</body>
</html>