redirect page using javascript

This code explains how to redirect a page using java script

by fredd man

HTML

<input type='button' id="demo" onclick="redirectPage1()" value="https://www.youtube.com./watch?v=wJT-YKmlWJc"/>

<input type='button' id="demo" onclick="redirectPage2()" value="go to w3 schools - method2"/>

<script>
function redirectPage1()
{
window.location.replace("https://moncryd.net");
}
 function redirectPage2()
{
window.location.href = "http://www.w3schools.com";
}   
</script>

JavaScript

//this example is best explained in www.coding-issues.com. Check the link for more details on how to redirect a page using javascript.