Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
<h1>The Window Location Object</h1>
<h2>The href Property</h2>
<p>Click the button to set the href value to https://www.w3schools.com.</p>
<button onclick="myFunction()">Take me to w3schools.com</button>
<script>
function myFunction() {
  location.href = "https://www.w3schools.com";
}
</script>
</body>
</html>