UNPKG

1.96 kBMarkdownView Raw
1[1]: https://secure.travis-ci.org/litejs/dom-lite.png
2[2]: https://travis-ci.org/litejs/dom-lite
3[3]: https://coveralls.io/repos/litejs/dom-lite/badge.png
4[4]: https://coveralls.io/r/litejs/dom-lite
5[npm package]: https://npmjs.org/package/dom-lite
6[GitHub repo]: https://github.com/litejs/dom-lite
7
8
9 @version 0.3.5
10 @date 2015-02-02
11 @stability 2 - Unstable
12
13
14DOM lite – [![Build][1]][2] [![Coverage][3]][4]
15========
16
17A small DOM implementation
18where most of DOM attributes and methods are implemented.
19
20
21Examples
22--------
23
24```javascript
25var document = require("dom-lite").document;
26
27var el = document.createElement("h1");
28el.id = 123;
29el.className = "large";
30
31var fragment = document.createDocumentFragment();
32var text1 = document.createTextNode("hello");
33var text2 = document.createTextNode(" world");
34
35fragment.appendChild(text1);
36fragment.appendChild(text2);
37el.appendChild(fragment);
38
39el.toString();
40// <h1 id="123" class="large">hello world</h1>
41el.outerHTML;
42// <h1 id="123" class="large">hello world</h1>
43el.innerHTML;
44// hello world
45```
46
47Implementation notes
48--------------------
49
50 - `innerHTML` and `outerHTML` are read only
51 - `querySelector()`, `querySelectorAll()`, `closest()` and `matches()`
52 does not support CSS3 selectors
53
54
55
56Coding Style Guidelines
57-----------------------
58
59- Use tabs for indentation, align with spaces
60- Use lowerCamelCase for method and variable names
61- Use UpperCamelCase for constructor names
62- Commit files with Unix-style line endings
63- Do not use spaces in file and directory names
64 Consider substituting a dash (-) where you would normally use spaces.
65- Rebase before pushing
66- Fix tests before push or pull request
67
68
69External links
70--------------
71
72- [GitHub repo][]
73- [npm package][]
74- [DOM spec](http://dom.spec.whatwg.org/)
75
76
77
78### Licence
79
80Copyright (c) 2014-2015 Lauri Rooden &lt;lauri@rooden.ee&gt;
81[The MIT License](http://lauri.rooden.ee/mit-license.txt)
82
83