1.0.0 • Published 6 years ago

hdotjs v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

h.js

Simple and Lightweight tool to manipulate DOM, avoiding string interpolation

Usage

var form = h('form', { children: [
  h('h1', { content: 'Title' }),
  h('div', { children: [
    h('label', { content: 'Label1: ' }),
    h('select', {
      attrs: { id: 'rule' },
      children: [
        h('option', { attrs: { value: '1' }, content: 'First' }),
        h('option', { attrs: { value: '2' }, content: 'Second' }),
        h('option', { attrs: { value: '3' }, content: 'Third' })
      ]
    })
  ]}),
  h('div', { children: [
    h('label', { content: 'Label2: ' }),
    h('input', { attrs: { type: 'text', id: 'field-1' } })
  ]}),
]})

document.body.appendChild(form)