Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Functions

  • childSelector(rootEl: HTMLElement, selector: string): null | HTMLElement
  • Get the first child that matches the given selector

    Parameters

    • rootEl: HTMLElement

      The parent element

    • selector: string

      The children selector

    Returns null | HTMLElement

  • childSelectorAll(rootEl: HTMLElement, selector: string): HTMLElement[]
  • Get all the children of the given root that match the given selector

    Parameters

    • rootEl: HTMLElement

      The parent element

    • selector: string

      The children selector

    Returns HTMLElement[]

  • findAllChildren(rootEl: HTMLElement, predicate: ((el: HTMLElement) => boolean)): HTMLElement[]
  • Find all the children that satisfy the given predicate

    Parameters

    • rootEl: HTMLElement

      The parent element

    • predicate: ((el: HTMLElement) => boolean)

      The predicate to satisfy

        • (el: HTMLElement): boolean
        • Parameters

          • el: HTMLElement

          Returns boolean

    Returns HTMLElement[]

  • findChild(rootEl: HTMLElement, predicate: ((el: HTMLElement) => boolean)): null | HTMLElement
  • Parameters

    • rootEl: HTMLElement
    • predicate: ((el: HTMLElement) => boolean)
        • (el: HTMLElement): boolean
        • Parameters

          • el: HTMLElement

          Returns boolean

    Returns null | HTMLElement

  • forEachChild(rootEl: HTMLElement, action: ((el: HTMLElement) => void)): void
  • Execute an action/callback on each child

    Parameters

    • rootEl: HTMLElement

      The parent element

    • action: ((el: HTMLElement) => void)

      The action/callback to execute on each child

        • (el: HTMLElement): void
        • Parameters

          • el: HTMLElement

          Returns void

    Returns void