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

I am unable to solve it

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" id="xpText">XP: 0</span>
        <span class="stat" id ="healthText">Health: 100</span>
        <span class="stat" id="goldText">Gold: 50</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 currentWeapon = 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/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36

Challenge Information:

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

Hello:)

You have to add another span element, for example:

<span>Hello World! <span id="uff">100</span></span>
2 Likes

Ah, and you have to wrap the new span element in strong element:

<strong><span></span></strong>
1 Like

Reset your challenge and add span opening and closing tags around your 0 , 100, and 50 text and add
within opening span tags required class values.

then add strong opening tags around your newly added span tags.
@kv2

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