On this page
children property
List<Element> childrenList of the direct children of this element.
This collection can be used to add and remove elements from the document.
var item = new DivElement();
item.text = 'Something';
document.body.children.add(item) // Item is now displayed on the page.
for (var element in document.body.children) {
element.style.background = 'red'; // Turns every child of body red.
}
Source
List<Element> get children => new _ChildrenElementList._wrap(this);
void children=(Source
set children(List<Element> value) {
// Copy list first since we don't want liveness during iteration.
var copy = value.toList();
var children = this.children;
children.clear();
children.addAll(copy);
}
© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dartlang.org/stable/1.24.3/dart-html/Element/children.html