Learn Form Validation by Building a Calorie Counter - Step 42

Tell us what’s happening:

code does not pass! it keeps telling me to remove targetId even after i have done so.

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(`${#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/126.0.0.0 Safari/537.36

Challenge Information:

Learn Form Validation by Building a Calorie Counter - Step 42

Your hash tag is in the wrong spot, it should be the very first thing after the backtick.

2 Likes

it’s still here tho, remove the line completely

1 Like

thank you so much. i removed the line completely and also remove the hashtag from the curly bracket.

You have the remove the first const targetId = ‘#’ + entryDropdown.value; completely.
Then you will remove the ${targetId} and replace targetId with what it tells you to. The # should be in the very beginning. Should look something like this!!

code removed by mods

hey @Wickid7594

It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge.

We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.