Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
domutil / impl / style.js
Size: Mime:
function v(val) {
    if (typeof val === 'number') {
        return val + 'px';
    } else {
        return val;
    }
}

exports.style = function(el, attribute, value) {
    if (typeof attribute === 'string') {
        el.style[attribute] = v(value);
    } else {
        for (var k in attribute) {
            el.style[k] = v(attribute[k]);
        }
    }
}

exports.removeStyle = function(el, attribute) {
    el.style[attribute] = '';
}