Learn Form Validation by Building a Calorie Counter - Step 45

Tell us what’s happening:

I believe I am passing the string correctly then using .length on the NodeList it returns but it is apparent that I am not. I’m not too sure what to do at this point and would love some assistance.

Your code so far

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

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

function addEntry() {
  const targetInputContainer = document.querySelector(`#${entryDropdown.value} .input-container`);
  const entryNumber = targetInputContainer.querySelectorAll("input[type='text']").length;
}

// 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/130.0.0.0 Safari/537.36

Challenge Information:

Learn Form Validation by Building a Calorie Counter - Step 45

The test is expecting double quotes for the inner string. So you have to use single quotes for the outer string.

'input[type="text"]'

Oh! Thanks so much, I had that earlier but instead of just having .length at the end I had NodeList.length so it didn’t work when I tried it earlier.