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

Conte-nos o que está acontecendo:

Descreva detalhadamente o problema aqui.

Seu código até o momento

<!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:
                <strong>
                    <span></span>
            </strong>
            </span>
            <span class="stat">Health:
                <strong>
                    <span></span>
            </strong>
            </span>
        </div>

<!-- User Editable Region -->

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

</html>

Informações do seu navegador:

Agente de usuário: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36

Informações do desafio:

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

I can’t get past this step. Objective: “Similar to your #stats element, your #monsterStats element needs two span elements. Give them the class stat and give the first element the text Monster Name: and the second the text Health: . After the text in each, add a strong element with an empty nested span element.”. I’ve included the and tags, but I’m not getting any further. Error: “Your second span element should have the text Health: . Make sure the spacing is correct.”. I’ve already modified the spacing of the second strong in several ways… Nothing worked.

1 Like

Hello @GabrielC !

Try moving all code for onto the same line.

Example:

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

This should work for you, I believe.

Keep up the good progress! :monkey_face:

1 Like

Hello, did you found the solution? im stuck on the same step. I don’t see what is the mistake.

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

        </div>

hey there @badaouikarima.pro , please create your own thread to ask for help

If you have a question about a specific challenge as it relates to your written code for that challenge and need some help, click the Ask for Help button located on the challenge (it looks like a question mark). This button only appears if you have tried to submit an answer at least three times.

The Ask for Help button will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.

2 Likes

Thanks, understood!
After many tries i figured it out.

1 Like

what did you do to pass this stage?

hi @billzonfred please create your own thread to ask for help

If you have a question about a specific challenge as it relates to your written code for that challenge and need some help, click the Ask for Help button located on the challenge (it looks like a question mark). This button only appears if you have tried to submit an answer at least three times.

The Ask for Help button will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.

1 Like

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