Tell us what’s happening:
I reviewed some other forms and they said there is a bug. I am not sure how can I pass the test. any help?
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
// User Editable Region
/* file: script.js */
// User Editable Region
const updateResultsList = () => {
resultList.innerHTML = "";
const name = ingredientName.value;
const capName = name.charAt(0).toUpperCase() + name.slice(1);
units.forEach((unit) => {
if (unit !== unitToConvert.value){
const finalQuantity = processIngredient(ingredientQuantity.value, unitToConvert.value, unit, numberOfServings.value);
const li = document.createElement('li');
li.textContent = `${capName}: ${parseInt(finalQuantity)} ${unit}s`;
resultList.appendChild(li);
}
})
}
recipeForm.addEventListener("submit", updateResultsList);
// User Editable Region
Your browser information:
User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36
Challenge Information:
Build a Recipe Ingredient Converter - Step 17