@jossmac/lil-libs
    Preparing search index...

    Function querySelectorAll

    • Thin wrapper around Element.querySelectorAll() that returns HTMLElement[] instead of NodeListOf<Element>.

      • el: Maybe<HTMLElement>

        Root element to search within. Returns [] when el is nullish.

      • selector: string

        CSS selector passed to Element.querySelectorAll.

      All matching HTMLElement nodes; non-HTML matches (e.g. SVG) are filtered out.

      const container = document.createElement("div");
      container.innerHTML = "<span>One</span><span>Two</span><svg><circle /></svg>";

      querySelectorAll(container, "span"); // [HTMLSpanElement, HTMLSpanElement]
      querySelectorAll(container, "span, circle"); // spans only
      querySelectorAll(undefined, "span"); // []