create-element

create dom element

5 months after

create-element License NPM version Dependency Status Build Status Coverage

Create DOM element.

Install

npm i @cloudcmd/create-element

API

const createElement = require('@cloudcmd/create-element');

// create DOM-element with no attributes
const div = createElement('div');

// add innerHTML
const el = createElement('div', {
    notAppend: false, // default
    parent: document.body, // default
    uniq: true, // default
    innerHTML: '<span></span>',
    className: 'abc',
});

// load css
const el = createElement('link', {
    rel: 'stylesheet',
    href: '/style.css',
    parent: document.head,
});

License

MIT

Related Repositories

element-api

element-api

Create a JSON API for your elements in Craft. ...

generator-element

generator-element

Yeoman generator to create Custom Elements using Polymer, X-Tag or VanillaJS ...

angular-custom-element

angular-custom-element

Web Components Custom Element enhanced directives! ...

base-element

base-element

:beginner: An element authoring library for creating standalone and performant e ...

slush-element

slush-element

Slush generator to create Custom Elements using Polymer, X-Tag or VanillaJS ...