Tell us what’s happening:
I am on Step 41 of Learn Form Validation by Building a Calorie Counter. The website preview has stopped showing for some reason and I’m getting this error under the “check your code” box. Another forum had the same code and was correct?
SyntaxError: unknown: Unexpected token, expected “,” (21:55) 19 | function addEntry() { 20 | const targetId = “#” + entryDropdown.value; > 21 | const targetInputContainer = document.querySelector(${targetId} .input-container); | ^ 22 | }
Your code so far
/* 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/124.0.0.0 Safari/537.36
Challenge Information:
Learn Form Validation by Building a Calorie Counter - Step 41