Cree una funcion llamada agregaritem para que cree un li y lo agregue al final de la lista con un id especifico

This commit is contained in:
2026-05-18 18:48:34 -03:00
parent 353406174d
commit 391417b4e8

View File

@@ -10,4 +10,13 @@ function agregarClaseItems() {
for (const item of items) {
item.classList.add("item-lista");
}
}
function agregarItem(texto) {
const lista = document.querySelector("#lista-inicial");
const nuevaLista = document.createElement("li");
nuevaLista.textContent = texto;
lista.appendChild(nuevaLista);
}