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