From e9dcded1f691a5d0d1b383c09e43185a60a5b791 Mon Sep 17 00:00:00 2001 From: Sergio Madera De Marco <37299705@terciariourquiza.edu.ar> Date: Sat, 16 May 2026 16:24:34 -0300 Subject: [PATCH] ejercicio 6: eliminar elementos de una lista con remove --- ejercicios-clase-8.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ejercicios-clase-8.js b/ejercicios-clase-8.js index f687258..cedb6ec 100644 --- a/ejercicios-clase-8.js +++ b/ejercicios-clase-8.js @@ -39,7 +39,7 @@ function destacarParrafos() { } } } -// Ejercicio 5 +// 5 function agregarComidasLitoral() { const div = document.createElement("div"); @@ -95,4 +95,13 @@ function agregarComidasLitoral() { div.appendChild(lista); document.body.appendChild(div); +} +// 6 + +function limpiarLista(idLista) { + const items = document.querySelectorAll(`#${idLista} li`); + + for (const item of items) { + item.remove(); + } } \ No newline at end of file