1.1.1 • Published 7 years ago

endom v1.1.1

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

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.

1.1.1

7 years ago

1.1.0

7 years ago

1.0.8

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago