0.1.6 • Published 11 months ago
create-and-append-element v0.1.6
create-and-append-element
This package allows you to create and place any HTML tag of your choice with ease.
This is my first package, hope it will be helpful. :)
Install
Install with npm:
$ npm install create-and-append-element
Usage
import createAndAppendElement from 'create-and-append-element';
// createAndAppendElement('tagName', whereToAppend, 'class', { attribute: value })
const link = createAndAppendElement('a', document.body, 'link', {
href: 'https://url.com',
// attributes...
});
const img = createAndAppendElement('img', link, 'image', {
src: 'https://image.png',
wdth: 500
});
About
Author
Simon Karapetyan