npm.io
0.3.0 • Published 7 years ago

@cspoels/element

Licence
MIT
Version
0.3.0
Deps
0
Size
3 kB
Vulns
0
Weekly
0

@cspoels:element

Install

yarn add @cspoels/Element

Use

To start, load the script

const Element = require('@cspoels/element')

To create a new element in the body of the document

let element = new Element(document.body).create()

An element will be created, it will remember the root for appending alter. The root parameter can be

  • A string: To search by id
  • A DOM element to appen dto
  • Another Element instance
  • [Default] null, will transform to document.body

you can alter the element with functions as:

element.class('is-primary').id('super-element').text('I am the best element')

Keywords