0.2.13 • Published 8 years ago

dom2 v0.2.13

Weekly downloads
39
License
-
Repository
-
Last release
8 years ago

Dom

Dom is a lightweight library to make cross browser work with DOM easier.

The library's core contains three modules:

  • Dom.Class provides methods to work with HTML elements' class names.
  • Dom.Element provides methods to work with HTML elements.
  • Dom.Event provides methods to woks with HTML events.

Also the core contains helpers Dom.closest, Dom.matches, and Dom.contains.

The library is designed for using on projects where performance matters.

Table of content

Key features

  • Works everywhere. See Browser support
  • Best performance: 5–10 times faster than jQuery, almost equals to direct calls of DOM API
  • Small footprint: ~3.5 KB (minified and gzipped)
  • No dependencies, no need polyfills
  • 100 % test coverage

Browser support

BrowserVersion
ChromeAll
EdgeAll
Safari3.0
Firefox2.0
Internet Explorer6.0
Opera9.2
Android2.1
iOS4.0

Install

Install via NPM:

npm install dom2 --save-dev

Usage

Include dom.js as a script tag in your HTML file:

<script src="path/to/dom.js"></script>
<script>
  // window.Dom is available here
</script>

Also you can use it as a ES6 module

import Dom from 'dom2'

// Now you can use Dom variable to access the API

Or as a CommonJS module:

var Dom = require('dom2');

// Now you can use Dom variable to access the API

Or as an AMD module:

define(['dom2'], function (Dom) {
  // Now you can use Dom variable to access the API
});

API

Dom.Class

.add()

.addSuffix()

.contains()

.getAll()

.remove()

.removeSuffix()

.toggle()

Dom.Event

.add()

.remove()

0.2.13

8 years ago

0.2.11

8 years ago

0.2.10

8 years ago

0.2.9

8 years ago

0.2.8

8 years ago

0.2.7

8 years ago

0.2.6

8 years ago

0.2.5

8 years ago

0.2.4

8 years ago

0.2.3

8 years ago

0.2.2

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago