campfire.js
    Preparing search index...

    Function insert

    • Inserts an element into the DOM given a reference element and the relative position of the new element.

      • if where looks like { after: reference }, the element is inserted into reference's parent, after reference.
      • if where looks like { before: reference }, the element is inserted into reference's parent, before reference.
      • if where looks like { into: reference, at: 'start' }, the element is inserted into reference, before its first child.
      • if where looks like { into: reference }, the element is inserted into reference, after its last child.

      Parameters

      • els: Element | Element[]

        The element(s) to insert.

      • where: ElementPosition

        An object specifying where to insert elem relative to another element.

      Returns Element | Element[]

      the element that was inserted, so you can do const a = insert(nu(), _).

      an Error when there are no valid keys ('into', 'after', or 'before') present in where.