Learn Form Validation by Building a Calorie Counter - Step 42

Tell us what’s happening:

It says “You should use a template literal in your querySelector method.”

Am I not using the template literal correctly?

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 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36

Challenge Information:

Learn Form Validation by Building a Calorie Counter - Step 42

Hi there and welcome to our community!

You’re almost correct but template literals use backticks (`), not single quote marks.

Thanks! I originally thought they was same thing haha.

1 Like