diff --git a/ejercicios-clase-8.js b/ejercicios-clase-8.js index a71b85c..90a0adb 100644 --- a/ejercicios-clase-8.js +++ b/ejercicios-clase-8.js @@ -17,4 +17,16 @@ for(const lista of agregarClase){ } -claseLi(); //Ejercicio 2 \ No newline at end of file +claseLi(); //Ejercicio 2 + + +function agregarItem(texto){ +const lista1 = document.querySelector("#lista-inicial"); +const agregarItemNuevo = document.createElement("li"); +agregarItemNuevo.textContent = texto; +lista1.append(agregarItemNuevo); +} + +agregarItem("ejemplo1"); +agregarItem("ejemplo2"); +agregarItem("ejemplo3"); //Ejercicio 3 \ No newline at end of file