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

I am having issues here i put in the necessary text which they asked and even try to put it in an

still not accepting i need help with this

here is my code

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="./styles.css">
    <title>RPG - Dragon Repeller</title>
</head>
<body>
    <div id="game">
        <div id="stats">
            <span class="stat">XP: <strong><span id="xpText">0</span></strong></span>
            <span class="stat">Health: <strong><span id="healthText">100</span></strong></span>
            <span class="stat">Gold: <strong><span id="goldText">50</span></strong></span>
        </div>
        <div id="controls">
            <button id="button1">Go to store</button>
            <button id="button2">Go to cave</button>
            <button id="button3">Fight dragon</button>
        </div>

<!-- User Editable Region -->

        <div id="monsterStats">
            <span class="stat">
                Monster Name :

            </span>
            <span class="stat"></span>


        </div>

<!-- User Editable Region -->

        <div id="text"></div>
    </div>
</body>
</html>

Your browser information:

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

Challenge Information:

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

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.

What error messages are you seeing?
It looks to me like your spacing is not correct for one thing.
Unless otherwise specified, when you add text to a span element it should look something like this:

<span>text here</span>

There are also several other requirements for this step which you have not yet completed.

You haven’t added the strong element and also haven’t written the text for the second one, also you need to nest another span element inside strong.

not sure if this is the best thing to do but here is how it should look like:
<span id= “monsterStats”> Monster Name : </span><strong><span></span></strong>

Again, your spacing inside your first span is still not correct. There should be no space before the text and there should also be no space before the colon.

Also, your span tags are not correct as the text ‘Monster Name:’ should be inside a span with the class ‘stat’.

I would hit the Reset button to get this starting code:

<div id="monsterStats">

</div>

… then follow these instructions word for word:

  1. Inside the div element add a span with the text 'Monster Name: ’ (ensuring there is a single space after the colon).
  2. Add a class of ‘stat’ to the opening span tag.
  3. Immediately following the text 'Monster Name: ’ (including the space), add a pair of strong tags.
  4. Inside the strong element add a pair of span tags.
  5. Now, starting immediately below the code you have just added, follow steps 1-4 again, but inserting the text 'Health: ’ this time.

If you have done this correctly your code should now pass.

1 Like

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