How to find the url of the current page

Manideepgoud
Posted by Manideepgoud under JavaScript category on | Points: 40 | Views : 1129
We use window.location.href to find the url of the page.

<p id="demo"></p>
<script>
var a= document.getElementById("demo").innerHTML =
"Page location is: " + window.location.href;
</script>

Comments or Responses

Login to post response