Learn Form Validation by Building a Calorie Counter - Step 39

Tell us what’s happening:

Hello I’m having trouble figuring out this question
My code:

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

I also tried
function addEntry() {
const targetId = ‘#’ + entryDropdown.value;
const targetInputContainer = document.querySelector(${targetId} '.input-container' );
}

also tried with space in front of input – document.querySelector(${targetId} '. input-container' );

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

Challenge Information:

Learn Form Validation by Building a Calorie Counter - Step 39

When I removed the extra spacing it passes for here

here is the extra space

Ohhh there was double space I didn’t even realize! Thank you!

1 Like

Where you able to complete task 40 i am having issues solving mine. hope i get a response from you thanks.