tsuite
    Preparing search index...

    Function mapElementsById

    • Returns an object mapping each query string to the corresponding HTMLElement (or null) found by id. The object keys are in PascalCase and prefixed with "el".

      Type Parameters

      • const T extends readonly string[]

        A tuple of string query names in kebab-case.

      Parameters

      • ...queries: T

        The list of id attribute names (in kebab-case) to query.

      Returns Elements<T>

      An object with keys in the form el<PascalCaseQuery> and values as the corresponding HTMLElement or null.

      const els = mapElementsById('foo-bar', 'baz');
      // els.elFooBar -> HTMLElement | null (for id="foo-bar")
      // els.elBaz -> HTMLElement | null (for id="baz")