how to redirect to another page with javascript code example Example: redirect with javascript window.location.replace('http://mywebsite.com/home.html');