From 242112f9969d1024731b1adb0ea3b133cb7eec17 Mon Sep 17 00:00:00 2001 From: Lucio Gaibazzi Date: Wed, 27 May 2026 02:24:17 -0300 Subject: [PATCH] Agrego un nuevo id a la lista del ejercicio 5 y agrego el ejercicio 6 de la clase 8 --- ejercicios-clase-8.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/ejercicios-clase-8.js b/ejercicios-clase-8.js index 37ac4b0..7c5c3ed 100644 --- a/ejercicios-clase-8.js +++ b/ejercicios-clase-8.js @@ -60,6 +60,7 @@ function crearNuevoDiv() { const lista = document.createElement("ul"); lista.classList.add("lista-comidas") + lista.id = "lista-litoral"; const comidas = ["Chipá", "Surubí", "Salmón", "Rabas"]; @@ -74,4 +75,17 @@ function crearNuevoDiv() { div.appendChild(lista); document.body.appendChild(div); -} \ No newline at end of file +} + + + +//Ejercicio 6 de la clase 8. + +function limpiarLista(idLista) { + const borrarItem = document.querySelectorAll(`#${idLista} li`); + + for (const borrarItems of borrarItem) { + borrarItems.remove(); + } +} +