Learn Form Validation by Building a Calorie Counter - Step 48

Tell us what’s happening:

been stuck on this lesson for a bit and haven’t been able to crack the code. am I supposed to be using\n for a new line? I tried it and it doesn’t work. I’m not sure what I’m missing. pls 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" placeholder="Name" id="${entryDropdown.value}-${entryNumber}-name"></input>
}

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.1 Safari/605.1.15

Challenge Information:

Learn Form Validation by Building a Calorie Counter - Step 48

No need for the newline character in template strings. You can just tap the enter key and write the next line of code and that counts as a newline.

The problem I see is that you didn’t put the new line inside the string. To be inside the string it has to be within the backticks.