Learn Form Validation by Building a Calorie Counter - Step 40

Tell us what’s happening:

I have done what they asked but it still passes and error message. I have reloaded the page and reset everything but it is still presenting the same error. Please help

Your code so far

<!-- file: index.html -->

/* file: styles.css */

/* file: script.js */
// User Editable Region

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

}

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

Challenge Information:

Learn Form Validation by Building a Calorie Counter - Step 40

Hello, welcome to our forum.
I do not think you need to interpolate the targetId. You should instead concatenate targetId and input-container

Hi there,

Your code is correct to get what we want to archive.
But you was ahead a few steps.

The instruction asked us to:

Use concatenation to separate targetId and '.input-container' with a space, and pass that string to querySelector().

So let just concatenating with operator + for now.
For the next step, we will use template literals and interpolation.

Thanks i have gotten it

Done. It worked, thanks alot