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

Tell us what’s happening:

Describe your issue in detail here.
as far as i think and see, its right and i did this multiple time
what’s the problem here,
" Sorry, your code does not pass. Don’t give up.

The text of your first .stat element should still be XP: 0.
"

Your code so far

<!-- User Editable Region -->

<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>


<!-- User Editable Region -->

Your browser information:

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

Challenge Information:

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

1 Like

Do you have two copies of the XP and Health stats?

As was mentioned, it looks like you have duplicates.

but also there might be a spacing issue and the test could probably be more flexible with that.

I am able to pass when I place everything on the same line like so

            <span class="stat">XP: <strong><span id="xpText">0</span></strong></span>
1 Like

I’ll go ahead and open an issue, because the spacing shouldn’t be too strict here for the tests

thanks,

<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>

this got submitted,
(i’ve tried to cut space in first .stat but it was not working and same error, but this time i did it with all and got it)

1 Like

Awesome!

Glad you were able to get it working.

Update: Issue has been created to make the spacing more flexible

2 Likes

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