Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/jolle/tini

🐀 Tini is a very tiny element creation helper
https://github.com/jolle/tini

Last synced: about 1 month ago
JSON representation

🐀 Tini is a very tiny element creation helper

Awesome Lists containing this project

README

        

# tini

A very tiny (~0.5kb) element creation helper. Supports styles, attributes, event listeners, text node creation, classes, IDs and children.

```js
import { mk } from 'tini';

document.body.appendChild(
mk(
'{color=red}[data-cool=yes].nice#hello',
"I'm a cool div",
mk('strong.extraCool', 'with a super cool strong tag!'),
function onclick() {
console.log('and I can listen for events too!');
},
mk('input[disabled=disabled]')
)
);
```