removeChildren method

void removeChildren(
  1. string tagName
)

Remove all child nodes with the given tagName.

Implementation

void removeChildren(string tagName) {
  while (hasChildren(tagName)) {
    getFirstChild(tagName)!.remove();
  }
}