json-dom
    Preparing search index...

    Function insertChild

    • Insert a child into a parent's children list at a given position (like appendChild, but positioned). Appending is insertChild at the end: appendChild(parent, child) is insertChild(parent, child, parent.children.length).

      Parameters

      • parent: DomItem

        The parent that will receive the child.

      • child: DomItem

        The new child to attach to the parent.

      • index: number

        Where in parent's children the child goes; out of range clamps to the nearest end, so 0 is always the front and a large index is always the back (matching Array.prototype.splice).

      Returns DomItem