npm install tag --save
or
<script src="tag.iife.js"></script>
- Parameters
- name: String
- attributes: Object (optional)
- children: Array | String
- Returns - HTMLElement
import tag from 'tag';
tag('div', { id: 'content' }, 'content');
tag('div', { id: 'content' }, [tag('span', 'content')]);
tag('div', [tag('span', '<strong>content</strong>')]);
tag('hr');
tag('label', [tag('input', { type: 'text' }), 'Label text']);
This software is released under the terms of the MIT license.