Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
<h1>The Window Location Object</h1>
<h2>The replace Property</h2>
<button onclick="myFunction()">Replace document</button>
<script>
function myFunction() {
  location.replace("https://www.w3schools.com")
}
</script>
</body>
</html>