Thunderfist

javascript
HTML5 JS Quiz help

2 posts in this topic

I'm trying to make a quiz that sends you to a different page based on your answers, and I was wondering if it's possible to use conditionals to decide which page you'll be sent to. Is it?

Share this post


Link to post
Share on other sites

You could set window.location.href to the new page like this:

if (something) {
    window.location.href = "page1.html";
} 
else {
    window.location.href = "page2.html";
}

 

Nesh108 likes this

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.