diff --git a/ejercicios-clase-8.js b/ejercicios-clase-8.js index 3234583..4c09eef 100644 --- a/ejercicios-clase-8.js +++ b/ejercicios-clase-8.js @@ -16,4 +16,15 @@ function destacarComidas() { for (const comida of comidas) { comida.style.color = "red"; } +} +// 3 + +function agregarItem(texto) { + const lista = document.querySelector("#lista-inicial"); + + const nuevoItem = document.createElement("li"); + + nuevoItem.textContent = texto; + + lista.appendChild(nuevoItem); } \ No newline at end of file