Learn Form Validation by Building a Calorie Counter - Step 46

Tell us what’s happening:

is somone can find my the error here ? i can’t find the mistake !!
: After your label element, and on a new line in your template string, create an input element. Give it a type attribute set to text , a placeholder attribute set to Name , and an id attribute that matches the for attribute of your label element.

Your code so far

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" placeholder="Name" id="${entryDropdown.value}-${entryNumber}-name">

Your browser information:

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

Challenge Information:

Learn Form Validation by Building a Calorie Counter - Step 46

Hello:)

To make your code more readable, you should put them between backticks:

1 Like

I cannot see your input element.

1 Like

After your label element, and on a new line in your template string, create an input element.

Your input element is outside the template string.

`inside template string`
outside template string
1 Like

thanks you so much … it works!:heart: