Learn Form Validation by Building a Calorie Counter - Step 40

I am getting this error: You should replace the targetId reference in your template literal with entryDropdown.value . However, I have removed targetId and replaced it. Not sure what is happening.

function addEntry() {
  const targetInputContainer = document.querySelector(`#${entryDropdown.value} + .input-container`);
}

Your browser information:

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

Challenge Information:

Learn Form Validation by Building a Calorie Counter - Step 40

2 Likes

Where did you get the + from? Its not in the original code given to you. You also need to make sure you have one space after the last } before the .

2 Likes

you just need to update the target value to the template value here is the working code.
like my answer if it worked.

function addEntry() {

const targetInputContainer = document.querySelector(#${entryDropdown.value} .input-container);
}

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