A simple utility for creating HTML5 tags.
npm install html5-tagA simple utility for creating HTML tags.
``bash`
npm install --save html5-tag
js
import tag from 'html5-tag';// No end tags for void elements (https://www.w3.org/TR/html5/syntax.html#void-elements)
tag('br');
// → '
'
tag('a', { href: 'http://example.com' }, 'Example');
// → 'Example'
tag('input', { name: 'name', value: 'Input your name...', disabled: true });
// → ''
tag('div', { title: '\'"&<>' }, tag('i', { class: 'icon icon-folder' }, ''));
// → '
'// Defaults to 'div' if tag is not specified
tag({ class: 'container' }, 'container text');
// → '
container text'
``Copyright (c) 2016 Cheton Wu
Licensed under the MIT License.