• Insert the values before the elements.

    Parameters

    • elements: Node[] | Iterator<Node, any, undefined>

      The target nodes.

    • values: Iterable<Node>

      The new nodes to insert.

    • Optional insertWith: Inserter

      The insertion function

    Returns void

    Example

    // Insert a span into all the children of the first main element:
    import {apply} from 'appliance'
    import {insert} from 'domitory'
    const span = document.createElement('span');
    apply({main: main => insert(main.children, main.children.map(() => span.cloneNode())))})