# DOMino

> == README

Latest version **1.0.1** (published 2016-10-18) · ISC license · 0 weekly downloads

## Install

```sh
npm install DOMino
pnpm add DOMino
yarn add DOMino
bun add DOMino
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2016-10-18 |
| First published | 2016-10-18 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | 6.2.1 |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Maintainers | douglastgordon |

## Links

- npm: https://www.npmjs.com/package/DOMino
- Repository: https://github.com/douglastgordon/DOMino
- Homepage: https://github.com/douglastgordon/DOMino#readme
- Issues: https://github.com/douglastgordon/DOMino/issues
- npm.io page: https://npm.io/package/DOMino

## Dependencies (1)

- [webpack](https://npm.io/package/webpack.md) ^1.13.2

## Recent versions

- 1.0.1 (latest) — 2016-10-18
- 1.0.0 — 2016-10-18

## README

# DOMino

**DOMino** is a lightweight JavaScript DOM manipulation library. DOMino can be used to dynamically manipulate HTML elements by getting, setting and removing classes, attributes, event listeners and more. Also use it to simplify AJAX requests.

The code snippet below shows how the messy job of appending an object or string to single or multiple HTML elements is conveniently packed into a single method:

```javascript

append(content) {
  if (this.elements.length === 0) return;
  switch(typeof(content)) {
    case "object":
      if (!(content instanceof DOMNodeCollection)) {
        content = $l(content);
      }
      this.elements.forEach( (element) => {
        content.elements.forEach(childNode => {
          element.appendChild(childNode.cloneNode(true));
        });
      });
    case "string":
      this.elements.forEach( (element) => element.innerHTML += content);
  }
}

```

## API

To import DOMino:
```javascript
import domino from './DOMino/main.js'
```

Find elements with a selector:
```javascript
domino('h1')
```

Create a DOMino element:
```javascript
domino(<marquee>Watch me go!</marquee>)
```

Run a script after page loads:
```javascript
domino(() => {
  console.log("Howdy!")
});
```

### Class Methods

####Make an ajax request:
```javascript
domino.ajax({
  type: 'GET',
  url: "someurl.com",
  success(data) {
    console.log(data)
  },
  error(){
    console.log(":(")
  }
});
```

### Instance Methods

#### .addClass(newClass)
#### .append(child)
#### .attr(name, value)
#### .children()
#### .empty()
#### .find(selector)
#### .html(content)
#### .parent()
#### .remove()
#### .removeClass(class)

### Event Listeners

#### .on(action, callback)
#### .off(action, callback)

---
_Source: https://npm.io/package/DOMino · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
