Learn Form Validation by Building a Calorie Counter - Step 41

Tell us what’s happening:

what is wrong with this code. I tried different methods to concat ’ .input-container’ bu still not passing.

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

Your code so far

<!-- file: index.html -->

/* file: script.js */
// User Editable Region

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

// User Editable Region
/* file: styles.css */

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36 Edg/132.0.0.0

Challenge Information:

Learn Form Validation by Building a Calorie Counter - Step 41

Instead of reassigning targetId put targetId + ' .input-container' inside querySelector