Advertisement
728x90
In vanilla javascript, you can redirect to a new page using the location property of window object. The syntax would be as follows,
javascript
1function redirect() {
2 window.location.href = "newPage.html";
3 }Advertisement
Responsive Ad
🎯 Practice NowRelated Challenge
JavaScript Coding Exercise 36
Test your knowledge with this interactive coding challenge.
Start CodingAdvertisement
728x90
120of476