add()
Adds an element to the instance.
Syntax
Nestable.add([element, [parent]])
Accepts a valid HTMLElement
node, instances of HTMLCollection
and NodeList
or an array of items as the first argument.
You can define the parent to which the new item will be appended to with the second argument. Defaults to the main list.
Demo
- Item 1
- Item 2
- Item 3
- Item 4
- Item 5
- Item 6
- Item 7
- Item 8