Push a color to the DOM - Node.js CSS

Node.js examples for CSS:Color

Description

Push a color to the DOM

Demo Code

function setColor(elements, attribute, color) {
    Array.prototype.forEach.call(document.querySelectorAll(elements), function (element) {
        element.setAttribute(attribute, "#" + color);
    });/*  w w w  .  j  av a  2 s.c o m*/
}

Related Tutorials