create-and-append-element

0.1.6 • Public • Published

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

Contributing Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/simonK605/create-and-append-element/issues/new).

Author

Simon Karapetyan

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i create-and-append-element

      Weekly Downloads

      1

      Version

      0.1.6

      License

      ISC

      Unpacked Size

      2.63 kB

      Total Files

      3

      Last publish

      Collaborators

      • simonkarapetyan