Dom
===

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

The library's core contains three modules:

- [Dom.Class](#Dom.Class)     provides methods to work with HTML elements' class names.
- [Dom.Element](#Dom.Element) provides methods to work with HTML elements.
- [Dom.Event](#Dom.Event)     provides methods to woks with HTML events.

Also the core contains helpers [Dom.closest](#Dom.closest), [Dom.matches](#Dom.matches),
and [Dom.contains](#Dom.contains).

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

## Table of content

- [Key features](#features)
- [Browsers support](#support)
- [Install](#install)
- [Usage](#usage)
- [API](#api)
  - [Dom.Class](#class)
  - [Dom.Event](#event)


<a name="features"></a>
## Key features

- Works everywhere. See [Browser support](#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


<a name="support"></a>
## Browser support

| Browser| Version |
|:-------|:--------|
| <img src="docs/img/chrome.png" alt="Chrome" width="16" height="16">  Chrome            | All    |
| <img src="docs/img/ie.png" alt="Edge" width="16" height="16">        Edge              | All    |
| <img src="docs/img/safari.png" alt="Safari" width="16" height="16">  Safari            | 3.0    |
| <img src="docs/img/ff.png" alt="Firefox" width="16" height="16">     Firefox           | 2.0    |
| <img src="docs/img/ie.png" alt="IE" width="16" height="16">          Internet Explorer | 6.0    |
| <img src="docs/img/opera.png" alt="Chrome" width="16" height="16">   Opera             | 9.2    |
| <img src="docs/img/android.png" alt="Chrome" width="16" height="16"> Android           | 2.1    |
| <img src="docs/img/ios2.png" alt="Chrome" width="16" height="16">    iOS               | 4.0    |


<a name="install"></a>
## Install

Install via NPM:

```javascript
npm install dom2 --save-dev
```

<a name="usage"></a>
## Usage

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

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

Also you can use it as a ES6 module

```javascript
import Dom from 'dom2'

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

Or as a CommonJS module:

```javascript
var Dom = require('dom2');

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

Or as an AMD module:

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


<a name="api"></a>
## API

<a name="class"></a>
### Dom.Class

<a name="class-add"></a>
#### .add()

<a name="class-addSuffix"></a>
#### .addSuffix()

<a name="class-contains"></a>
#### .contains()

<a name="class-getAll"></a>
#### .getAll()

<a name="class-remove"></a>
#### .remove()

<a name="class-removeSuffix"></a>
#### .removeSuffix()

<a name="class-toggle"></a>
#### .toggle()

<a name="event"></a>
### Dom.Event

<a name="event-add"></a>
#### .add()

<a name="event-remove"></a>
#### .remove()
