clearElementChildren function
void
clearElementChildren(
- HTMLElement container
Removes all child nodes from the given container element.
This function iterates over all children of the container
and removes them until no child remains.
Example:
clearElementChildren(myDiv);
Implementation
void clearElementChildren(web.HTMLElement container) {
while (container.firstChild != null) {
container.removeChild(container.firstChild!);
}
}