Skip to content

Latest commit

 

History

History
30 lines (22 loc) · 1.67 KB

File metadata and controls

30 lines (22 loc) · 1.67 KB

Module: lib.dom.append

README -> API Index -> Modules Index -> lib.dom.append

Source: src/lib/dom/append.js

DOM insertion and replacement helpers with position-based placement.

Exported Functions

  • before - Insert e before target.
  • after - Insert e after target.
  • prepend - Insert e as first child of target.
  • append - Insert e as last child of target.
  • beforeBegin - Insert e immediately before target using adjacent positioning.
  • afterBegin - Insert e as the first child inside target.
  • beforeEnd - Insert e as the last child inside target.
  • afterEnd - Insert e immediately after target using adjacent positioning.
  • adjacent - Insert using DOM-standard positions (mirrors insertAdjacentElement).
  • replace - Replace target with element.
  • remove - Remove target from DOM.
  • empty - Empty a target (remove all children).
  • resolveTarget - Resolve a target-ish input into a DOM Element.

Related