Build a Recipe Ingredient Converter - Step 18

Tell us what’s happening:

I don’t really understand why updateResultsList doesn’t update DOM when clicking the button

Your code so far

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

/* file: styles.css */

/* file: script.js */
// User Editable Region
const updateResultsList = () => {
  resultList.innerHTML = "";
  for (let i of units){
    if (i !== unitToConvert) {
      let processedIngredient = processIngredient(ingredientQuantity, unitToConvert, i, numberOfServings)
      let li = document.createElement()
      li.appendChild(document.createTextNode(ingredientName.for + ":", processedIngredient, i))
      resultList.appendChild(li)
    }
  }
};

recipeForm.addEventListener("submit", (event) => {
  event.preventDefault();
  updateResultsList();
});
// 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/151.0.0.0 Safari/537.36

Challenge Information:

Build a Recipe Ingredient Converter - Step 18

GitHub Link: freeCodeCamp/curriculum/challenges/english/blocks/workshop-recipe-ingredient-converter/673543d867b44ac7580610a2.md at main · freeCodeCamp/freeCodeCamp · GitHub

Welcome to the forum, @armadilliummaculatum,

Look at what you’re passing to processingIngredient:

Log your arguments: console.log(unitToConvert, ingredientQuantity, numberOfServings)

Now open your browser’s console to see that you are passing HTML elements. How do you get at their values?

Happy coding

thanks. here’s my fixed code if anything:

code removed by moderator

Congratulations on solving the challenge! You should be proud of your achievement…we are! But we are removing your working solution, so it is not available to others who have not yet done the work to get there. Again, congrats!