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.
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.
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>