Javascript step 37 calorie counter

Instruction-set:[ Step 37

You’ll need to know which category the entry goes in. Thankfully, you added a dropdown for the user to select a category.

Remember that you queried that dropdown earlier in your JavaScript and assigned it to the entryDropdown button. You can use the value property to get the value of the selected option.

Use concatenation to add a # to the beginning of the value property of entryDropdown, and assign that result to a targetId variable.]

end code:

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

The above code is correct. My question is "where would the information be for us to know that this is the correct code:[ const targetInputContainer = document.querySelector(targetId + ' .input-container');] . where is it located?

I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

in this step you don’t need to create a targetInputContainer variable, there isn’t written anywhere because you don’t need to add it here

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