Unable to understand the difference in required code and my code
Your code so far
<!-- 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/134.0.0.0 Safari/537.36 Edg/134.0.0.0
Challenge Information:
Learn Form Validation by Building a Calorie Counter - Step 43
entryDropdown.value is a variable, so treat it the exact same way you used targetId, it’s just a different variable name. The # is not part of the variable name, but it will be the first character in your template literal string.
where are you ending the template literal? you have a syntax error
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.
Hi,
You have started your template literal using a backtick (`) character, and it looks like you’re on track. To keep going, have a look at the MDN documentation about template literals to see examples of the syntax to use.