diff --git a/ejercicios-clase-8.js b/ejercicios-clase-8.js index 236771a..7e60d00 100644 --- a/ejercicios-clase-8.js +++ b/ejercicios-clase-8.js @@ -12,4 +12,14 @@ for (const p of item) { console.log("Clase agregada a:", p); } } -//ejercicio 3 \ No newline at end of file +//ejercicio 3 +function agregarItem(texto){ + const lista = document.querySelector("ul"); + +const nuevoItem = document.createElement("li"); +nuevoItem.textContent = texto ; +nuevoItem.id= "lista-inicial"; +lista.appendChild(nuevoItem); +console.log("Clase agregada a:", nuevoItem) +} +//ejercicio 4 \ No newline at end of file