• Set specified properties and/or attributes on the specified elements (or their children). Pass an iterable of elements (often an array) as the first arg and an object mapping property names to value iterables to be matched against the elenments at corresponding indices.

    If a key in values starts with the underscore (_), the attribute with the name following the underscore will be set.

    Parameters

    • elements: Iterable<Element | CSSStyleRule>
    • values: ISetMap
    • Optional undefinedIsEmpty: boolean

    Returns [Iterable<Element | CSSStyleRule>, ISetMap]

    Example

    // Shuffle the class attributes of all the children of the first main element:
    import { set } from 'deleight/queryoperator';
    import { uItems } from 'deleight/generational';
    const main = document.querySelector('main');
    const values = uItems(main.children.map(c => c.className));
    set(main.children, {_class: values});