Learn Basic JavaScript by Building a Role Playing Game - Step 4

tried arranging and rearranging but my code still didnt pass

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="./styles.css">
    <title>RPG - Dragon Repeller</title>
</head>
<body>
    <div id="game">
        <div id="stats">

<!-- User Editable Region -->

<span class="stat"><strong>XP:</strong> <span id="xpText"><strong><span>0</span></strong></span></span>
<span class="stat"><strong>Health:</strong> <span id="healthText"><strong><span>100</span></strong></span></span>
<span class="stat"><strong>Gold:</strong> <span id="goldText"><strong><span>50</span></strong></span></span>


<!-- User Editable Region -->

        </div>
        <div id="controls"></div>
        <div id="monsterStats"></div>
        <div id="text"></div>
    </div>
</body>
</html>

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36

Challenge Information:

Learn Basic JavaScript by Building a Role Playing Game - Step 4

Step 37
button1.onclick = function () {
goStore;
};
Why is this wrong? And where do you present the correct answer?

The instructions for step 37 state to set the onclick of button1 to the goStore function. The instructions do not say to create a new function that then calls goStore. All you need is:

button1.onclick = goStore();

Make sure you post in a thread that talks about step 37 so it’s easy for the rest of us to get to that step, see the requirements, and better help you out.

hey @coloradoz99

If you have a question about a specific challenge as it relates to your written code for that challenge and need some help, click the Ask for Help button located on the challenge (it looks like a question mark). This button only appears if you have tried to submit an answer at least three times.

The Ask for Help button will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.

Thank , this is my first try at this and the directions are unclear as to how to ask. I feel like that is what my code is doing still not seeing why wrong…

Thanks , totally did not see that button, will look for it next time.

I am trying to ask a question step 50 using the method you descripted
my code is correct
button3.onclick = fightDragon;
“You are in the town square. You see a sign that says "Store" .”;
but the auto grader is not accepting it…

when I click the help button no matter if I click on Read-Search-Ask or check if question has already been answered on forum or create a post on forum I get a pop up that says the site cannot be reached. " This site can’t be reached

Check if there is a typo in forum.freecodecamp.dev.

  • If spelling is correct, [try running Windows Network Diagnostics](javascript:diagnoseErrors()).

DNS_PROBE_FINISHED_NXDOMAIN"
I am sorry if this is not the way to ask this but can find no other way nor any documentation as to how …

That’s interesting, you should not be directed to forum.freecodecamp.dev… are you doing the lessons on freecodecamp.org or freecodecamp.dev?

using the only option that I have which is .dev

I changed the URL to .org will check then next time I get stuck to see if that fixes the problem. Many thanks

do not use the .dev site, it can be brought down at any moment, and all your progress will be lost. Please use freecodecamp.org

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.