<!doctype html>
<head>
<title>Location object Method example</title>
</head>
<body>
<p>Location Methods example</p>
<button onclick="load1()">visit studytonight.com</button>
<button onclick="load2()">visit studytonight.com</button>
<button onclick="load3()">visit studytonight.com</button>
<script>
// assign method
function load1(){
location.assign("https://www.studytonight.com");
}
// href
function load2(){
location.href="https://www.studytonight.com";
}
// replace()
function load3(){
location.replace("https://www.studytonight.com");
}
</script>
</body>
</html>