May 2019
Beginner to intermediate
650 pages
14h 50m
English
The methods listed here alter the structure of a DOM tree, either by adding new elements, changing their position, or detaching them from the tree. Since selections are immutable, these methods always return new selections:
|
Method |
Description |
|
append(tagname | function) |
If the parameter is a string, it must be a tag name. The method will create a new element and append it as the last child of each element in the selection, returning a new selection with the appended nodes. If the selection is an enter selection (see general update pattern), the nodes are added as siblings following the selected nodes. If the parameter is a function, it must return a DOM element to be appended. |
|
insert( ... |
Read now
Unlock full access