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

As always, it is not clear from the instructions what to do? If yes, where can I read detailed instructions?

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

<!-- User Editable Region -->

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

<!-- User Editable Region -->

        </div>
        <div id="controls"></div>
        <div id="monsterStats"></div>
        <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/118.0.0.0 YaBrowser/23.11.0.0 Safari/537.36

Challenge Information:

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

Hey @mashabukinam You are doing great reset the step to get the original html the you need to wrap the numbers.Only the numbers in a span
element and then wrap that span in span in strong element like so

<strong><span>text</span></strong>

Happy coding

XP: 0 0
it doesn’t work on this site

Post your updated code please

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

You need to wrap the existing 0 not creating another one

this doesn’t work either

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

now you are missing a space, it was XP: 0, it should still be like that, now you don’t have the space between : and 0

Give a space after: and do the same for the remaining two the code will only pass if you do the same for all of them

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