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

Tell us what’s happening:

Describe your issue in detail here.

Your code so far

<!DOCTYPE html>
<html lang="en">
    <meta charset="utf-8">
    <link rel="stylesheet" href="./styles.css">
    <title>RPG - Dragon Repeller</title>
    <div id="game">
      <div id="stats">

<!-- User Editable Region -->

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

<!-- User Editable Region -->

      <div id="controls"></div>
      <div id="monsterStats"></div>
      <div id="text"></div>

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:109.0) Gecko/20100101 Firefox/115.0

Challenge Information:

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

You appear to have created this post without editing the template. Please edit your post to Tell us what’s happening in your own words.

Your first span element should be wrapped around the text 0.


This is how we begin this step.

  <span class="stat">XP: 0</span>
        <span class="stat">Health: 100</span>
        <span class="stat">Gold: 50</span>

We are asked to do the following:
Quoted from the instructions:

  1. Wrap the numbers 0, 100, and 50 in span elements

  2. wrap those new span elements in strong elements

  3. give your new span elements id values of xpText, healthText, and goldText, respectively.

We are not to add the id values to the original span elements.

Suggestion: Reset the step and read and follow closely the instructions.

I hope the above breakdown will help you!

I had difficulty with this one, too.

Wishing you good progress!