Tell us what’s happening:
It keeps telling me that my function is not updating the DOM correctly, even though it seems good to me.
I tried string concatenation for appending a
- element, didn’t work aswell.
Also tried resetting the lesson, which didn’t do anything for me.
Pls be so kind and help me
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
// User Editable Region
const updateResultsList = () => {
resultList.innerHTML = "";
units.forEach( (current) => {
if (current !== unitToConvert.value) {
const convertedQuantity = processIngredients(ingredientQuantity.value, unitToConvert.value, current, numberOfServings.value);
const newLi = document.createElement("li");
newLi.textContent = `${(ingredientName.value)}: ${convertedQuantity} ${current}`;
resultList.appendChild(newLi);
}
});
}
// 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/140.0.0.0 Safari/537.36
Challenge Information:
Build a Recipe Ingredient Converter - Step 17
https://www.freecodecamp.org/learn/full-stack-developer/workshop-recipe-ingredient-converter/step-17