1.1.2 • Published 3 years ago

newel v1.1.2

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

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
1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago