An open API service indexing awesome lists of open source software.

https://github.com/bredele/attrs

Object as DOM attributes
https://github.com/bredele/attrs

Last synced: over 1 year ago
JSON representation

Object as DOM attributes

Awesome Lists containing this project

README

          

# attrs

Object as DOM attributes.

## usage

```js
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';
}
})
```