Function getSiblingsFocusableElements

  • Retrieves the focusable siblings of a given element within the document.

    This function identifies all focusable elements in the document body and determines the siblling elements relative to the specified element. If the specified element is not found among the focusable elements, it returns null for both siblings.

    Parameters

    • element: HTMLElement

      The element for which to find focusable siblings.

    Returns {
        nextSibling: null;
        previousSibling: null;
    } | {
        nextSibling: HTMLElement;
        previousSibling: HTMLElement;
    }