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

Tell us what’s happening:

I keep getting an error when prompted to put the script at the end of the tag.

Your code so far

<!DOCTYPE html>
<html lang="en">
<link styesheet = "styles.css">
<head>
    <meta charset="UTF-8">
    <title>RPG - Dragon Repeller</title>
</head>
<body>
<div id ="game" >
    <div id="stats">
        <span class="stat">XP: <strong><span id="xpText">0</span></strong></span>
        <span class="stat">Health: <strong><span id="healthText">100</span></strong></span>
        <span class="stat">Gold: <strong><span id="goldText">50</span></strong></span>

    </div>
    <div id="controls">
        <button id="button1">Go to store</button>
        <button id="button2">Go to cave</button>
        <button id="button3">Fight dragon</button>
    </div>
    <div id="monsterStats">
        <span class="stat">Monster Name: <strong><span></span></strong></span>
        <span class="stat">Health: <strong><span></span></strong></span>
    </div>
    <div id="text">Welcome to Dragon Repeller. You must defeat the dragon that is preventing people from leaving the
        town. You are in the town square. Where do you want to go? Use the buttons above.</div>
</div>
<script src="script.js"></script>
</body>
</html>

Your browser information:

Chrome:
Version 120.0.6099.130 (Official Build) (64-bit)

Challenge Information:

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

Hi @ashleyhelen808
Your code should pass all tests. It did not throw any errors on my end. Plus your script is perfectly positioned. Can you try resetting the lesson and running the same code?

Thanks for the quick response, looks like there is still an error after the reset.
I have been working on an IDE and migrating the code over to the console for checking… Ill manually type and see if that works. Something to consider in the future.

Correction: retyping by hand instead of copy/paste did not work as well.

Maybe you should move the script to the end of your body element, after the </body> as the hint suggests, try that and let me know the response. Do not mind that this will conflict with the earlier instructions.

Similar response, I am noticing a spillover of html in this step as well.

Let the script be below the </body>. This time, share an actual code instead of a screenshot.

No problem, this solution is still giving me an error

<!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">
            <span class="stat">XP: <strong><span id="xpText">0</span></strong></span>
            <span class="stat">Health: <strong><span id="healthText">100</span></strong></span>
            <span class="stat">Gold: <strong><span id="goldText">50</span></strong></span>
        </div>
        <div id="controls">
            <button id="button1">Go to store</button>
            <button id="button2">Go to cave</button>
            <button id="button3">Fight dragon</button>
        </div>
        <div id="monsterStats">
            <span class="stat">Monster Name: <strong><span id="monsterName"></span></strong></span>
            <span class="stat">Health: <strong><span id="monsterHealth"></span></strong></span>
        </div>
        <div id="text">
            Welcome to Dragon Repeller. You must defeat the dragon that is preventing people from leaving the town. You are in the town square. Where do you want to go? Use the buttons above.
        </div>
    </div>
</body>
<script src="./script.js"></script>
</html>

I also have a separate macbook that hasn’t had an updated chrome download yet, and it is throwing an error as well with all suggested fixes.

Your code still passes all tests. Try the following.

  1. Disable any existing browser extensions.
  2. Make sure your browser is up to date.
  3. Use a different browser and make sure the zoom level is 100%.

Thank you, it was an extension issue that resolved the problem

You’re very welcome. Kepp doing the good work.

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