diff --git a/ejercicios-clase-8.js b/ejercicios-clase-8.js index 13c9599..3a809a7 100644 --- a/ejercicios-clase-8.js +++ b/ejercicios-clase-8.js @@ -62,4 +62,13 @@ function agregarComidasLitoral() { contenedor.appendChild(lista); document.body.appendChild(contenedor); +} + +function limpiarLista(idLista){ + + const items = document.querySelectorAll(`#${idLista} li`); + + for (const item of items){ + item.remove(); + } } \ No newline at end of file