Projects | Contribute in GitHub

litejs

@version    0.5.1
@date       2016-07-26
@stability  2 - Unstable

DOM lite – Build Coverage

A small DOM implementation where most of DOM attributes and methods from document are implemented.

Examples

var document = require("dom-lite").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>" ]

Coding Style Guidelines

Licence

Copyright (c) 2014-2016 Lauri Rooden <[email protected]>
The MIT License


Tags: browser, document, dom, litejs

Have an update or suggestion for this note? You can edit it and send me a pull request.

Fork me on GitHub

Since 2013 to 2015