accessibility

Helpers related to universal accessibility

Overview

Universal accessibility is a core goal of the Elix project. These helpers are used by mixins like AriaListMixin and AriaMenuMixin to support accessibility via ARIA.

API

defaultAriaRole constant

A dictionary mapping built-in HTML elements to their default ARIA role.

Example: defaultAriaRole.ol returns "list", since the default ARIA role for an ol (ordered list) element is "list".

ensureId(element) static method

If the given element already has an ID, return it. If not, generate a previously unused ID and return that.

Parameters:

  • element: Element

Returns: string