Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9012617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:02:53+00:00 2026-06-16T03:02:53+00:00

So right now I’m trying to program what would essentially be a simple game

  • 0

So right now I’m trying to program what would essentially be a simple game where the user is given a riddle and when they give the correct answer they are allowed to move on to the next riddle.
Right now i can bring up a prompt that you then answer the question for which leads to more text, and i can hypothetically add a button in … but then along with the button comes all of the coding surrounding it also?
Is there anyway to fix this? Or is there a better coding alternative for what i’m trying to do? I kind of wish I knew how to use forms instead of prompts and buttons but from what i’ve tried to find i can’t seem to see any way of doing that.

Here’s what i’ve written so far (sorry i haven’t posted on this website before, i’m actually just pretty desperate now) (Ps. Im aware that i’m very bad at coding):

<p>Click the button!.</p>

<button onclick="myFunction()">Try it</button>


<p id="demo"></p>

<script>

function nextButton()
{{
<button onclick="nextButton()">Next question!</button>
}

var y;
var name=prompt("What are bunnies?");

if (name!="fluffy")
{
 y= name + " " + "is" + " " + "wrong!";
 document.getElementById("demo").innerHTML=y;
 }
 else
 {
 y="correct!";
 document.getElementById("demo").innerHTML=y;
 }
 }

 function myFunction()
 {
 var x;

 var name=prompt("what is cute a fluffy and adorable?");

 if (name!="a bunny")
  {
  x= name + " " + "is" + " " + "wrong!";
  document.getElementById("demo").innerHTML=x;
  }
  else
  {

  x="correct!" + nextButton ;
 document.getElementById("demo").innerHTML=x;
  }
 }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T03:02:54+00:00Added an answer on June 16, 2026 at 3:02 am

    Maybe change your nextButton function to the following:

    function nextButton()
    {
       return "<button onclick='nextButton()'>Next question!</button>";
    }
    

    and see if that works.

    EDIT: Also change

    x="correct!" + nextButton ;
    

    To:

    x="correct!" + nextButton() ;
    

    That should fix the script problem.

    Good luck!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Right now I'm asking the user for two numbers. I'm trying to print the
Right now I have 3 tables: User, Roles, and User_Roles for the many-to-many association.
Right now I am trying to instantiate the Circle class (which is a subclass
Right now I am only trying to get my getline() function to work. I
Right now I am using learning to program for the iphone and I am
Right now I have a simple class that handles the parsing of XML files
Right now I'm learning Opencart, and I'm trying to make my latest product display
Right now I'm working on small project, submitting very simple jobs and I'm working
Right now I'm working on a dataset where I would like to return records
Right now I am trying to research on how stable Spring release are right

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.