From f80218541e6a0409eece6991e024a8de477e90a8 Mon Sep 17 00:00:00 2001 From: Facundo Saucedo <43495919@terciariourquiza.edu.ar> Date: Thu, 14 May 2026 14:37:01 -0300 Subject: [PATCH] feat: add cleanList function to delete specified elements from the DOM --- ejercicios-clase-8.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ejercicios-clase-8.js b/ejercicios-clase-8.js index bc885a5..f16cca3 100644 --- a/ejercicios-clase-8.js +++ b/ejercicios-clase-8.js @@ -59,4 +59,13 @@ const newSection = () => { list.appendChild(li); }); div.appendChild(list); +} + +// Ejercicio 6 + +const cleanList = (id) => { + const list = document.getElementById(id); + while (list.firstChild) { + list.removeChild(list.firstChild); + } } \ No newline at end of file