Learn Form Validation by Building a Calorie Counter - Step 48

Tell us what’s happening:

Hi guys,

This is my code:

    <input type="text" placeholder="Name" id="${entryDropdown.value}-${entryNumber}-name">`;

I am not sure what I am doing wrong.

I would appreciate if someone could direct or guide me as to where I am going wrong.

Thanking you

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

// 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/127.0.0.0 Safari/537.36 Edg/127.0.0.0

Challenge Information:

Learn Form Validation by Building a Calorie Counter - Step 48

Delete the backtick and semicolon here as they are ending the string literal too early.

Thanks for your help.

1 Like