Function getSiblings

  • getSiblings(elem: AnyNode): AnyNode[]
  • Gets an elements siblings, including the element itself.

    Attempts to get the children through the element's parent first. If we don't have a parent (the element is a root node), we walk the element's prev & next to get all remaining nodes.

    Returns

    elem's siblings, including elem.

    Parameters

    • elem: AnyNode

      Element to get the siblings of.

    Returns AnyNode[]