1.0.0 • Published 7 years ago

create-dom v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

create-dom

NPM version Gitter Dependency Status

Lightweight create DOM element helper.

Install

There are several ways to get a copy of create-dom. Pick whichever one you like:

  • Use it via UNPKG: https://unpkg.com/create-dom/index.js. This is a simple way to embed it on a webpage without having to do any other setup.
  • Install via NPM: npm install --save create-dom
  • Install via YARN: yarn add create-dom

Require

const dom = require('create-dom');

Documentation

Examples

Add title with link to body

document.body.appendChild(
  dom('div', {}
    dom('h1', {}
      dom('a', { href: 'https://github.com/ghoullier/create-dom' }, 'Fork me on GitHub!')
    )
  )
)