0.2.2 • Published 5 years ago

element-helper-lite v0.2.2

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

element-helper-lite

GitHub package.json version GitHub

Installation

$ npm i -D element-helper-lite

Methods

const elementsCreate: (eArgs: IElementCreate) => HTMLElement
const elementAddToDoc: (el: HTMLElement, location: ElLocation) => void
const elementAddNewToDoc: (eArgs: IElementCreate, location: ElLocation) => HTMLElement

Enums

enum ElLocation

Interfaces

interface IElementCreate

Example

const args: IElementCreate = {
  tag: 'div',
  attribs: {
    id: 'tinybox',
    class: 'gmbox gmbox-window'
  },
  children: [{
    tag: 'div',
    attribs: {
      class: 'gmclose'
    }
  },
  {
    tag: 'div',
    attribs: {
      id: appSettings.fullScreenRealId,
    },
    children: [{
        tag: 'textarea',
        attribs: {
          id: appSettings.tinyId,
          rows: '18',
          cols: '66'
        }
      }]
  },
  {
    tag: 'div',
    attribs: { id: 'za_one', class: 'za' }
  }]
}
elementAddNewToDoc(args, ElLocation.head);
0.2.2

5 years ago

0.2.1

5 years ago

0.1.0

5 years ago