JavaScript Step 17 problem

Wrap the numbers 0 , 100 , and 50 in span elements, and wrap those new span elements in strong elements. Then give your new span elements id values of xpText , healthText , and goldText , respectively.

Hi, what’s the problem? Show your code, please.

1 Like
XP:0 Health:1XP00 Gold:50

I have enter the code but won’t get the answer can you help me out?

Sure, but please, show your source code, not the output

When I have enter the code it shows the output not the code

        <!-- <strong id="xpText"><span>XP: </span><span>0</span></strong> -->
        <!-- <strong id="healthText"><span>Health: </span><span>100</span></strong> -->
        <!-- <strong id="goldText"><span>Gold: </span><span>50</span></strong> -->
    <!-- </div> -->

The error we get is **You should add a strong element in your first .stat element.

Got you. Wrap the spans with ids into strong tags and XP, Health and Gold should be wrapped in span tags with class=“stat”

Can you share the code ?

Yes, but try to do it yourself with my help :slight_smile: You can reset the task, it will be better to start again

I will try myself let me know how to proceed…

Ok, after the reset firstly wrap the numbers 0 , 100 , and 50 in span elements


Yes, this is the initial template, all is ok

and secondly, wrap these new spans in strong tags


and in the end, add the ids to the spans around 0 , 100 , and 50
here is the structure:

  <span id=""></span>

The mistake is you put the opening strong tag before the span class, it should be right before the number


Yes, this is better, but don’t touch span with the class “stat”, it will be like this

Remove it from span with id

The correct line is looks like this:

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

Hope I helped :slight_smile:

1 Like