https://github.com/erickzanardo/h.js
Simple and Lightweight tool to manipulate DOM, avoiding string interpolation
https://github.com/erickzanardo/h.js
Last synced: 4 months ago
JSON representation
Simple and Lightweight tool to manipulate DOM, avoiding string interpolation
- Host: GitHub
- URL: https://github.com/erickzanardo/h.js
- Owner: erickzanardo
- License: mit
- Archived: true
- Created: 2018-01-18T13:11:08.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-03-08T01:27:33.000Z (about 7 years ago)
- Last Synced: 2024-10-25T15:35:25.029Z (7 months ago)
- Language: JavaScript
- Size: 25.4 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# h.js
Simple and Lightweight tool to manipulate DOM, avoiding string interpolation
# Usage
```javascript
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)
```