-3

I have created a quiz in javascript and I am using HTML forms to present it. I have verifed all of the users answers with if statements and if they get it either right or wrong a prompt box pops up to ask if they want to try again. When they say yes the quiz starts again but when they say no nothing happens and I would like it to automatically redirect itself to my homepage. Does anyone know how to do that? My website is not on a server it needs to be able to run off a CD or a USB.

3 Answers3

1

Use window.location. here's an example:

window.location.replace("yourpage.htm");

0

Use the window.location object:

window.location.assign("http://www.w3schools.com");
drdwilcox
  • 3,833
  • 17
  • 19
0

use window.location There are many ways. my favourite is

window.location.href = "http://yourhomepage.com";
Adween
  • 2,792
  • 2
  • 18
  • 20