Learn Form Validation by Building a Calorie Counter - Step 48

Tell us what’s happening:

I used the “\n” to add a new line, but it doesn’t pass.

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

// User Editable Region

Your browser information:

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

Challenge Information:

Learn Form Validation by Building a Calorie Counter - Step 48

You didn’t need to add that.

Hi all,
I am having the same issue, the solution doesn’t work for me…

My code so far is the below:

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

Please can you kindly provide any suggestions in where the error may be?

Thanks in advance.

Welcome to the FCC forum. Create your own topic to the challenge step, using help button on the challenge editor. You can find it after clicking check your code three times.

1 Like