1.1.2 • Published 3 years ago
newel v1.1.2
newel
This module helps you more easily create new html elements and add them to the DOM.
Install
npm install newel
Load Library
ES6
import newElement from 'newel';
Common JS
const newElement = require('newel');
USAGE
newElement(element, parentElement, text)
or if you need an element without a textnode:
newElement(element, parentElement)
EXAMPLES
Example - create element with text node:
const element = 'p';
const parentElement = document.body;
const text = 'This is a new paragraph appended to the body';
const myNewEl = newElement(element, parentElement, text);
Example - create element without text:
const element = 'div';
const parentElement = document.body;
const myNewEl = newElement(element, parentElement);
Licence
License ISC