• Sets a property on 1 or more elements.

    Parameters

    Returns ((value) => ((elements) => void))

      • (value): ((elements) => void)
      • Parameters

        • value: any

        Returns ((elements) => void)

          • (elements): void
          • Parameters

            • elements: Element | Iterable<Element>

            Returns void

    Example

    import { setter } from 'deleight/dom/components'
    import { apply } from 'deleight/dom/apply'

    document.body.innerHTML = `
    <div>I am a div</div>
    <p>I am a paragraph</p>
    <section>I am a section <button>Btn1</button></section>
    <article>I am an article <button>Btn2</button></article>
    `;

    const val = setter('propKey');
    apply({ section: { button: val(20) }, article: { button: val(33) } });