Learn Form Validation by Building a Calorie Counter - Step 45

Tell us what’s happening:

function addEntry() {
  const targetInputContainer = document.querySelector(`#${entryDropdown.value} .input-container`);
  const entryNumber = targetInputContainer.querySelectorAll('input[type="text"]').length;
  const HTMLString = `${" "}`;
}

please tell me whats wrong with my code

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 = `${" "}`;
}

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36

Challenge Information:

Learn Form Validation by Building a Calorie Counter - Step 45

This isn’t an empty template literal.

i asked chatGPT, that helped me, ``

That is template literals Syntex for converting a variable value to text. You to add only template literals. Means two back ticks.

1 Like

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