Learn Form Validation by Building a Calorie Counter - Step 38

Tell us what’s happening:

It is telling me: to concatenate ‘.input-container’ to targetId and to remember a space at the beginning but I added it to the end of the string with the space in front.

### Your code so far

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

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36

Challenge Information:

Learn Form Validation by Building a Calorie Counter - Step 38

1 Like

targetId is delcared as const it cannot be reassigned, nor it is expected. Try concatenating needed string to the targetId when passing argument to querySelector.

8 Likes

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