om.DomNode.appendChild

Adds an existing node at the end of the list of children in the current node.

Syntax

appendChild(
   newChild om.DomNode )
  1. newChild is a reference to a node.

Usage

The appendChild() method takes an existing om.DomNode element node and adds it at the end of the children of the object node calling the method.

The child node passed to the appendChild() method must have been created from the same DOM document object, for example with the om.DomDocument.createElement() method.

If the node passed to the appendChild() method is already attached to another parent node, it will be detached from that parent node before being attached to the new parent node.

Example

DEFINE parent, child om.DomNode
...
LET child = parent.appendChild("Item")

For a complete example, see Example 1: Creating a DOM tree.