Edit This Code:
<!DOCTYPE html>
<html>
<head>
<script>
function newDoc() {
    window.location.assign("http://www.w3schools.com")
}
</script>
</head>
<body>

<input type="button" value="Load new document" onclick="newDoc()">

</body>
</html>


Result:
Try it Yourself - © w3schools.com
Privacy Policy