endom

1.1.1 • Public • Published

endom

Import objects directly from the main package, e.g.:

const document = require('endom').document;

or

import { Element } from 'endom';

Create globals

require('endom/register')

Example

require('endom/register')
const h1=document.createElement('h1');
h1.setAttribute('n', 'v');
h1.style.setProperty('color','red');
h1.innerHTML = 'w0f w0f';
h1.classList.add('cls');
console.log(h1.outerHTML);

Supported methods

  • createElement(nodeName)
  • createTextNode(value)
  • appendChild(node)
  • replaceChild(node)
  • removeChild(node)
  • insertBefore(new, existing)
  • toString()
  • setAttribute(name, value)
  • getAttribute(name)
  • setProperty(name, value)
  • getProperty(name)
  • innerHTML()
  • outerHTML()
  • textContent()

Setters update existing objects, otherwise create anew;

Properties

  • innerHTML
  • outerHTML
  • textContent
  • attribute.value
  • attribute.name
  • everything else

Credits

This project was forked from html-element, written by 1N50MN14 and contributors.

Readme

Keywords

none

Package Sidebar

Install

npm i endom

Weekly Downloads

0

Version

1.1.1

License

MIT

Last publish

Collaborators

  • esz