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

Tell us what’s happening:

please help me i cant understand the problem of my code

Your code so far

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

<!-- User Editable Region -->

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

<!-- User Editable Region -->

      </div>
      <div id="controls"></div>
      <div id="monsterStats"></div>
      <div id="text"></div>
    </div>
  </body>
</html>
/* file: script.js */
let xp = 0;
let health = 100;
let gold = 50;
let currentWeaponIndex = 0;
let fighting;
let monsterHealth;
let inventory = ["stick"];

Your browser information:

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

Challenge Information:

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

Hi there, welcome to the community!

The lesson asks:

Wrap the numbers 0, 100, and 50 in span elements, and wrap those new span elements in strong elements. Then give your new span elements id values of xpText, healthText, and goldText, respectively.

However, your current code doesn’t follow the required structure. Make sure it looks like this:

Example Code
<span class="stat">TEXT <strong><span id="VALUE">TEXT</span></strong></span>

This format keeps your code clean and matches the lesson’s requirements. Keep going, you’re almost there!