Learn Form Validation by Building a Calorie Counter - Step 39

hello! i’m stuck at step 39. i’ve tried other versions of writing the code but it’s not working.

Your code so far

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

the console displays this message:
// running tests You should use a template literal in your querySelectormethod.
Your template literal should have the value {targetId} .input-container
. // tests completed

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36 Edg/121.0.0.0

Challenge Information:

Learn Form Validation by Building a Calorie Counter - Step 39

you need to put this inside querySelector directly

1 Like

Hi @larysa14

image

The instructions are asking you to use template literal syntax.
They allow using variables without the need to use the concatenation operator.

Here is a W3Schools article you may find helpful.

Happy coding

1 Like

Thaks guys!i solved it! I understand now. :grin:

1 Like

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