Learn Form Validation by Building a Calorie Counter - Step 48

Tell us what’s happening:

I am stuck on this step so far i have tried to correct the errors but it is still not working
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>`;
}

Your browser information:

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

Challenge Information:

Learn Form Validation by Building a Calorie Counter - Step 48

Your label element should be in a separate line between the temple literals (`).

Not sure if the whole of your code is presented here, but there should be an input element at the end of your template string. i.e. ’ 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.’

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.