dom-lightning
v1.2.0
Published
A small DOM implementation
Downloads
12
Readme
dom-lightning
A refactor of dom-lite with some stuff added.
Development
npm i
npm test
Examples
var document = require("dom-lightning").document;
var el = document.createElement("h1");
el.id = 123;
el.className = "large";
var fragment = document.createDocumentFragment();
var text1 = document.createTextNode("hello");
var text2 = document.createTextNode(" world");
fragment.appendChild(text1);
fragment.appendChild(text2);
el.appendChild(fragment);
el.innerHTML;
// hello world
el.innerHTML = "<b>hello world</b>"
el.outerHTML;
// <h1 id="123" class="large"><b>hello world</b></h1>
el.querySelectorAll("b");
// [ "<b>hello world</b>" ]