Learn Form Validation by Building a Calorie Counter - Step 44

Step 44

Start your HTMLString with a new line, then create a label element. Give that element the text Entry # Name, using your template literal syntax to replace # with the value of entryNumber.

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

welcome @manju.gurung to our community! :balloon: :tada: :confetti_ball:

this is not asked on the instruction so please remove it, and you should be good to go!