attrs

object to dom attributes

MIT 5 个版本
安装
npm install attrs
yarn add attrs
pnpm add attrs
bun add attrs
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';
  }
})
版本列表
2.0.0 2016-03-22
1.1.0 2016-05-03
1.0.0 2016-05-03
0.0.1-security 2016-03-23
0.0.0 2013-03-29