Function wrapElementNow

Wraps the element in the given wrapper, or a newly created element if not given.

  • Parameters

    • element: Element
    • Optionaloptions: { ignoreMove?: boolean; wrapper?: HTMLElement | (keyof HTMLElementTagNameMap) }
      • OptionalignoreMove?: boolean

        If true, the DOM watcher instances will ignore the operation of replacing the element (so as to not trigger relevant callbacks).

      • Optionalwrapper?: HTMLElement | (keyof HTMLElementTagNameMap)

        If it's an element, it is used as the wrapper. If it's a string tag name, then a new element with this tag is created as the wrapper. If not given, then div is used if the element to be wrapped has an block-display tag, or otherwise span (if the element to be wrapped has an inline tag name).

    Returns HTMLElement

    The wrapper element that was either passed in options or created.