agregado funcion agregarItem

This commit is contained in:
maximo hidalgo
2026-05-18 18:46:47 -03:00
parent 09c0b0afc7
commit b50d8a2bb6

View File

@@ -12,4 +12,14 @@ for (const p of item) {
console.log("Clase agregada a:", p);
}
}
//ejercicio 3
//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