From 005d201af18f90ca1a4b0fca62dd0a217359822e Mon Sep 17 00:00:00 2001 From: maximo hidalgo <47135001@gmail.com> Date: Mon, 18 May 2026 19:49:32 -0300 Subject: [PATCH] agrega funcion de limpiar lista --- ejercicios-clase-8.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ejercicios-clase-8.js b/ejercicios-clase-8.js index 12eee7c..4805335 100644 --- a/ejercicios-clase-8.js +++ b/ejercicios-clase-8.js @@ -45,7 +45,7 @@ function agregarDiv() { const nuevoul = document.createElement("ul"); nuevoul.classList.add("lista-comida") - + const comida1 = document.createElement("li"); comida1.textContent = "Chipa"; @@ -65,4 +65,11 @@ function agregarDiv() { document.body.appendChild(nuevoDiv); } - +//ejercicio 6 +function limpiarLista(idLista){ + const borrador = document.querySelectorAll(`#${idLista} li`) + for (const li of borrador){ + li.remove(); + } +} +//ejercicio 7 \ No newline at end of file