Learn Form Validation by Building a Calorie Counter - Step 49

Tell us what’s happening:

Hello,
I don’t understand why my label element code is not passing. Kindly help

Your code so far

<!-- file: index.html -->

/* file: styles.css */

/* file: script.js */
// User Editable Region

function addEntry() {
  const targetInputContainer = document.querySelector(`#${entryDropdown.value} .input-container`);
  const entryNumber = targetInputContainer.querySelectorAll('input[type="text"]').length;
  const HTMLString = `
  <label for="${entryDropdown.value}-${entryNumber}-name">Entry ${entryNumber} Name</label>
  <input type= "text" id="${entryDropdown.value}-${entryNumber}-name" placeholder="Name" />
  <label for= "${entryDropdown.value}-${entryNumber}-calories">Entry-${entryNumber}-Calories</label>`;
}

// 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/125.0.0.0 Safari/537.36

Challenge Information:

Learn Form Validation by Building a Calorie Counter - Step 49

There are no space between for= and its value.


This label should have the text Entry # Calories

Replace - with a space.

Thanks for the reply. However, it’s still not working.

Please post your updated code.

Remember to use the Preformatted Text button:

When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

Hello!

Suggestion:  
Reset the step to clear any failed code. It will only affect this step and not affect any previously completed steps. 

I, usually, review code above my current step to see if I can use any of it for reference on how to complete the current step.  

In this case, I would use: 

[quote="andrewkiema94, post:1, topic:693498"]
` <label for="${entryDropdown.value}-${entryNumber}-name">Entry ${entryNumber} Name</label>`
[/quote]

as a reference on how to complete the step with the calories.  
It is important to remember not to add any "-" that are not in the reference code to my step.  Only replace the necessary text.  

You do have it on the new line, correctly.

Hope this helps you.