I am writing a recipe website submit form and in the form I increase the amount of ingredients with this code.
addIngredientsBtn.addEventListener('click', function(){
let newIngredients = ingredientDiv.cloneNode(true);
let input = newIngredients.getElementsByTagName('input')[0];
input.value = '';
ingredientList.appendChild(newIngredients);
});
how do I reverse this to remove nodes from the form? Thanks for any help