<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>