Create DOM nodes using h functions
NOTICE This is not a patch function, it simply creates DOM nodes.
var node = h('div', { class: 'foo' }, [
h('span', null, 'foo'),
' bar'
])
document.body.appendChild(node)
npm i h2dom
This function follows the h2spec guidelines.
tag
: the element name passed todocument.createElement(name)
data
(optional): an object containing the attributes to set on the elementchildren
(optional): an array of DOM nodes or primitive values to be listed underelement.childNodes