Learn Form Validation by Building a Calorie Counter - Step 44

It feels like an error was made in this question, it’s asking for a line break and I think most people are trying \n or <br but it’s not either of those, you have to just press Enter manually so your code moves to the next line.

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>`;

Just copy paste this code to skip the question

1 Like

I agree, it is a tricky question. I too tried the \n and the <br> before finding the solution in the forum. But it isn’t really an error, is it? What did you (and I) learn? You learned that a string literal sees an actual “Enter/return key” as a new line. It might be better, however, if the code hint, upon seeing a \n or <br>, directed the learner to try simply pushing the enter/return key.

1 Like