SkillAgentSearch skills...

H2dom

Create DOM nodes using h functions

Install / Use

/learn @jamen/H2dom
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

h2dom

Create DOM nodes using h functions

NOTICE This is not a patch function, it simply creates DOM nodes.

Example

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

document.body.appendChild(node)

Install

npm i h2dom

Usage

This function follows the h2spec guidelines.

h(tag, data?, children?)

  • tag: the element name passed to document.createElement(name)
  • data (optional): an object containing the attributes to set on the element
  • children (optional): an array of DOM nodes or primitive values to be listed under element.childNodes

Related Skills

View on GitHub
GitHub Stars10
CategoryProduct
Updated4y ago
Forks3

Languages

JavaScript

Security Score

65/100

Audited on Dec 19, 2021

No findings