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

Tell us what’s happening:

“The text of your first .stat element should still be XP: 0”

tried everything and even solved in VsCode editor to prevent type errors but still something is off.

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

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





       

<!-- 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 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.6 Safari/605.1.15

Challenge Information:

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

Hello and welcome back to the forum community @lewzr !

Great attempt!

You have done a great job of adding the span id.

However, it appears the original numbers were left in place and new was added.

Suggestion: Remove the first numbers and just leave the new added code.

As well, please assure the proper id values are present for each set of code, along with the correct text (number) within the span in the code below.

I hope this helps you!

Wishing you good progress on your coding journey. :slightly_smiling_face: