0 votes
in JavaScript by
How do you redirect new page in javascript?

1 Answer

0 votes
by

In vanilla javascript, you can redirect to a new page using the location property of window object. The syntax would be as follows,

function redirect() {
  window.location.href = "newPage.html";
}
...