Getting an error that I don't have the right HTMLString

Tell us what’s happening:

I’m getting the following error

Your label element should have the text Entry ${entryNumber} Name.

but I’ve logged the output of HTMLString and I’m getting

<label>‘Entry 0 Name’</label>

So I’m super confused what’s going wrong.

Your code so far

  const entryNumber = targetInputContainer.querySelectorAll('input[type="text"]').length;
  console.log(entryNumber);
  const HTMLString = `
  <label>'Entry ${entryNumber} Name'</label>`;
  console.log(HTMLString);

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/119.0

Challenge Information:

Learn Form Validation by Building a Calorie Counter - Step 44

Check that inside label we use “for” also check the single quote around the text elements, since already have backticks, so no need additional quotes around text elements

It was the single quotes :person_facepalming: thanks!

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.