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

Tell us what’s happening:i submitted but i don’t really know what im doing

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</span>
        <span class="stat">Health: 100</span>
        <span class="stat">Gold: 50</span>
        
        <strong>
           <span id="xpText">0</span>
        <span id="healthText">100</span>
        <span id="goldText">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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36

Challenge Information:

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

help me showing what’s wrong

Okay here’s what you need to do for the challenge. You need to nest the original 0, 100, and 50text inside their own span elements. Then surround each new span element with its own strong element.

After you accomplish that, add ids to each of your new span elements.

Let me know if you need any further help.

help me showing it cause i did lots of trials

You should add a strong element in your first .stat element. thats the result im getting

Can you show me your updated code?

You have modified your code. Reset your challenge and add span opening and closing tags around your existing 0, 100, and 50 you have between span class stat.

Then add strong opening and closing tags around your newly added span tags.

Then add required id and value within span tags you nested in strong tags.
@a2937

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