Noteworthy Programming Masterpiece
Miss any of our Open RFC calls?Watch the recordings here! »

tag

0.4.16 • Public • Published

tag

GitHub license npm version npm downloads Build Status npm bundle size (minified) npm bundle size (minified + gzip)

Installation

npm install tag --save

or

<script src="tag.iife.js"></script>

tag(name, *attributes, children)

  • Parameters
    • name: String
    • attributes: Object (optional)
    • children: Array | String
  • Returns - HTMLElement

Example

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'
])

License and Copyright

This software is released under the terms of the MIT license.

Keywords

Install

npm i tag

DownloadsWeekly Downloads

138

Version

0.4.16

License

MIT

Unpacked Size

9.79 kB

Total Files

7

Last publish

Collaborators

  • avatar