Learn Form Validation by Building a Calorie Counter - Step 47

Tell us what’s happening:

Step 47: HTMLString template literal, correct answer showing as incorrect

I think i broke this step. The request: Inside your template literal, create a label element and give it the text Entry # Name. Using your template literal syntax, replace # with the value of entryNumber.

the variable created: const HTMLString = <label>Entry ${entryNumber} Name</label>;

yet its saying ‘You should have a label element inside your template literal’

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>Entry ${entryNumber} Name</label>`;

};

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

Challenge Information:

Learn Form Validation by Building a Calorie Counter - Step 47

Hi there and welcome to our community!

The code you put inside your HTMLString is correct but something may be amiss elsewhere.
I would hit the Reset button and then paste the same code in again.

thanks that worked. thought reset would redo the whole project

No, the Reset button only resets the code for the current step. Very useful if you get yourself in a bit of a tangle!