From 391417b4e8265bf5e5277a252dbbff243b741f58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Blas=20Alarc=C3=B3n?= <47840816@terciariourquiza.edu.ar> Date: Mon, 18 May 2026 18:48:34 -0300 Subject: [PATCH] Cree una funcion llamada agregaritem para que cree un li y lo agregue al final de la lista con un id especifico --- ejercicios-clase-8.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ejercicios-clase-8.js b/ejercicios-clase-8.js index 0407aa0..f653fca 100644 --- a/ejercicios-clase-8.js +++ b/ejercicios-clase-8.js @@ -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); } \ No newline at end of file