Learn Form Validation by Building a Calorie Counter - Step 49 [answer bug]

another bug. I added the same code but it say you should not modify your existing element which is ridiculus. please fix this. thanks.

I had to copy the whole codeblock from the next page to pass but it identical. I check by eyes and AI to compare.

the problematic code block

// 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" id="${entryDropdown.value}-${entryNumber}-name" placeholder="Name" />  
  <label for="${entryDropdown.value}-${entryNumber}-calories">Entry ${entryNumber} Calories</label>`;
  
}

// 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/125.0.0.0 Safari/537.36

Challenge Information:

Learn Form Validation by Building a Calorie Counter - Step 49

Reset your challenge step, and when you try to add new line of code for the challenge, just place the cursor before closing template literal and press enter. Then add your new code.

1 Like

already done that. as I said I had to copy the whole code block from next page to pass. it show error that I modified existing code but I did not.

Post the link to the challenge step.

please do not remove the link from the template

the regex test has issues with the extra spaces at the end of this line

Thank you for helping make FCC better. Bugs can be reported as GitHub Issues. Whenever reporting a bug, please check first that there isn’t already an issue for it and provide as much detail as possible.