feat: add cleanList function to delete specified elements from the DOM
This commit is contained in:
@@ -60,3 +60,12 @@ const newSection = () => {
|
|||||||
});
|
});
|
||||||
div.appendChild(list);
|
div.appendChild(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ejercicio 6
|
||||||
|
|
||||||
|
const cleanList = (id) => {
|
||||||
|
const list = document.getElementById(id);
|
||||||
|
while (list.firstChild) {
|
||||||
|
list.removeChild(list.firstChild);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user