How TO - Redirect to Another Webpage
Redirect a Webpage
window.location.href = "http://www.w3schools.com";
// Simulate an HTTP redirect:
Note: The difference between href and replace, is that
replace() removes the URL of the current document from the document history, meaning that it is not possible to use the "back" button to navigate back to the original document.
Tip: For more information about the Location Object, read our Location Object Reference.