h2dom

0.1.0 • Public • Published

h2dom

Create DOM nodes from h()

An h2spec h() function made for creating DOM nodes:

var node = h('div', { class: 'foo bar' }, [
  h('span', 'hello world'),
  ' foobar'
])

document.body.appendChild(node)

Install

npm i h2dom

Usage

h(tag, data?, children?)

A h() function specified in h2spec

var node = h('p', { class: 'test' }, 'hello world')
// <p class='test'>hello world</p>

document.body.appendChild(node)

Readme

Keywords

none

Package Sidebar

Install

npm i h2dom

Weekly Downloads

1

Version

0.1.0

License

MIT

Last publish

Collaborators

  • npm