attrs
v1.1.0
Published
object to dom attributes
Downloads
121
Readme
attrs
Object as DOM attributes.
usage
var attrs = require('attrs');
var bool = true;
var input = document.createElement('input');
attrs(input, {
id: 'input',
checked: true,
class: ['hello', 'world'],
style : {
top: 100 + 'px',
bottom: 200 + 'px'
},
type: function() {
return bool ? 'radio' : 'checkbox';
}
})