Elementals.js

Latest Version: 2.0 RC 3 14 March 2017

Method _.queryAll

Allows you to query the children of an element using a CSS style selector. Similar to how Element.querySelectorAll works in modern browsers.

Calling Convention:
_.queryAll(Element, selector)
Parameters
Element
The document Element node in which to search
selector
A CSS style selector to match
Returns
An Array of all document nodes that match the CSS.

Unlike Element.QuerySelectorAll this routine returns an Array, not a nodeList. This is done so that:

  1. It was easier to make the IE polyfill return an Array, so the behavior across all browsers is consistent.
  2. You can leverage all those wonderful new features of Array that ECMAScript 5/newer introduced and that elementals.js takes the time to polyfill on IE11/earlier.