diff --git a/ejercicios-clase-8.js b/ejercicios-clase-8.js index 87a3c1b..144ec6e 100644 --- a/ejercicios-clase-8.js +++ b/ejercicios-clase-8.js @@ -9,4 +9,14 @@ function agregarClase(){ for (const i of listaComida){ i.classList.add("item-lista"); } +} + +function agregarItem(texto){ + const lista = document.querySelector("#lista-inicial"); + const nuevo = document.createElement("li"); + + nuevo.textContent = texto; + + lista.appendChild(nuevo); + } \ No newline at end of file