Helper function to get the language direction of a given element, useful for figuring out if left-to-right or right-to-left specific logic should be applied.

  • Parameters

    • targetElement: HTMLElement

      Element the helper will get the language direction of

    • OptionaldefaultDirection: "ltr" | "rtl"

      Language direction to assume if one can't be determined, defaults to 'ltr'

    Returns "ltr" | "rtl"

    • The language direction of the target element