how to redirect to another page using js code example
Example 1: redirect javascript
window.location.replace("http://stackoverflow.com");
window.location.href = "http://stackoverflow.com";
Example 2: javascript redirect
window.location.href = "http://mywebsite.com/home.html";
Example 3: redirect with javascript
window.location.replace('http://mywebsite.com/home.html');
Example 4: javascript redirect
<p onclick="myFunction()"></p>
<script>
function myFunction() {
window.location.href = "https://whereyouwouldliketogo.com"
}
</script>