Learn Form Validation by Building a Calorie Counter - Step 79

Tell us what’s happening:

I got tired now changed my code repeatedly but all in vain. can anyone help here

Your code so far

output.innerHTML =<span class="${surplusOrDeficit.toLowerClass()}"> </span>;

WARNING

The challenge seed code and/or your solution exceeded the maximum length we can port over from the challenge.

You will need to take an additional step here so the code you wrote presents in an easy to read format.

Please copy/paste all the editor code showing in the challenge from where you just linked.

Replace these two sentences with your copied code.
Please leave the ``` line above and the ``` line below,
because they allow your code to properly format in the post.

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

Challenge Information:

Learn Form Validation by Building a Calorie Counter - Step 79

output.innerHTML =<span class="${surplusOrDeficit} ${.toLowerClass()}"> </span>;

code start with back ticks also

did u resolve it?

If not, try to check the part of setting surplusOrDeficit part.
Check the function that u need to apply to it.

No still no progress
Your output.innerHTML string will need a span element. Create that, and give it a class attribute set to the surplusOrDeficit variable, but lowercased.

Strings have a .toLowerCase() method that can help you with this. Do not give your span any text yet.
it was the requirement of challenge but unable to solve yet

you need one single use of ${} here, it should be the same expression. .toLowerClass() on its own is a syntax error

1 Like

check how u are writting the lower case function

output.innerHTML = `<span class = "${surplusOrDeficit.toLowerCase()}"></span>`;

this worked for me

1 Like

I needed to remember how to use the ${} within template literals. Also important to use the quotation marks correctly which had me wondering for a moment there. Thank you for the signal on correct syntax.