Redirect a url using javascript

We can use window.location.replace(…) or window.location.href to redirect a url using javascript.

//Behave as an HTTP redirect
window.location.replace("https://www.w3spoint.com");

//Behave as clicking on a link
window.location.href = "https://www.w3spoint.com";

Related topics:

Please Share