Quiz app to close feedback popup and go to the next question?

I am working on a quiz app with the following feature. a user answers the question, a popup feedback comes up, click on “continue” on the popup, it closes popup window and go to a different page of the main window. Is it likely to do in Javascript?

Thanks,

Hi,

Welcome to the forums :slight_smile:

Sure you can do this using JavaScript. Is there any part you’re stuck on?

Thanks for your willingness to help.
Actually I’m using a program called Lectora and using actions from the program when trying to do this. The program generates codes (sometimes Javascript). The area I am stuck at is the a feedback popup (on top of the main quiz page). I’d like to set the popup to close itself and then go to a specific page (= next question). So I set an action to close window and the next action to go to a page. The program would just close the popup window without being able to go to the page I’d like it to go. I think once it closes the window, the next action never gets executed. Since the program allows you to add Javascript manually to a page, I wonder if I can resolve it by adding Javascript directly.

Thanks for the help,

Something like this?

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Confirm example</title>  
  </head>
  <body>
    <a href="http://sitepoint.com" id="continue">Click me</a>
    
    <script>
      var continueLink = document.getElementById("continue");
      continueLink.addEventListener("click", function(e){
        if (!confirm("Do you want to continue?")){
          e.preventDefault();
        }
      });
    </script>
  </body>
</html>

Thank you. I will give it try and report back later. THANKS!