Learn Form Validation by Building a Calorie Counter - Step 80

Tell us what’s happening:

I don’t know what is wrong with my code. The line of code with asterisk.

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

Your browser information:

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

Challenge Information:

Learn Form Validation by Building a Calorie Counter - Step 80

It is because of the new line inside the span element. If you put it all on one line it should pass.

BTW, I removed the asterisks from your code (just so it is easier to test).


The test should likely be updated to not care about new lines.

1 Like

Thank you so much. It worked.

1 Like