I have a code like this and I have read it according to the instructions, but why is there still an error? with a message like this: You should call document.querySelectorAll() with #breakfast input[type=number].
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
// User Editable Region
function calculateCalories(e) {
e.preventDefault();
isError = false;
const breakfastNumberInputs = document.querySelectorAll("#breakfast input[type='number']");
}
// 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/127.0.0.0 Safari/537.36
Challenge Information:
Learn Form Validation by Building a Calorie Counter - Step 69
You have accidentally deleted some letters from the link copy the challenge link again and post it here.
Edit: you can see extra words preformatted text with the link.
Hi @hasanzaib1389 ,
I’m trying to understand, why there is no need for quote marks around number. The opposite is the case for the addEntry() function (Step 44). Does this mean we can also go without the quote marks at breakfastNumberInputs variable in that function and in any similar case?
hi there!
it’s tested with a regex that does not expect quotes, that’s why it doesn’t pass. but the quote marks around attribute value is also correct.