//example 1 document.getElementById("lbl_url").innerHTML = "Page location is " + window.location.href; //example 2 var x = location.href;