Learn Form Validation by Building a Calorie Counter - Step 42

Tell us what’s happening:

The challenge is asking me to replace a the variable “targetId” in the literal with “entryDropdown.value”. I have tried this in many different ways but I still can’t get the code to pass.

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

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

/* file: styles.css */

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

function addEntry() {
  const targetInputContainer = document.querySelector(`$#entryDropdown.value .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/125.0.0.0 Safari/537.36

Challenge Information:

Learn Form Validation by Building a Calorie Counter - Step 42

Welcome to the forum @talexratcliffe

The syntax is not quite right.

Please reset the step to restore the original code.
Then add the # before the code, then replace the old code with the new code.

Happy coding

1 Like

That worked.

Thank you kindly.

1 Like