# element-addclass

> Tiny zero dependency helper module for adding classes to elements

Latest version **1.0.2** (published 2020-01-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install element-addclass
pnpm add element-addclass
yarn add element-addclass
bun add element-addclass
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2020-01-29 |
| First published | 2020-01-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Leon Slater |
| Maintainers | mynamesleon |
| Keywords | addClass, element, element-addclass |

## Links

- npm: https://www.npmjs.com/package/element-addclass
- Repository: https://github.com/mynamesleon/element-addclass
- Homepage: https://github.com/mynamesleon/element-addclass#readme
- Issues: https://github.com/mynamesleon/element-addclass/issues
- npm.io page: https://npm.io/package/element-addclass

## Recent versions

- 1.0.2 (latest) — 2020-01-29
- 1.0.1 — 2020-01-09
- 1.0.0 — 2020-01-09

## README

# element-addclass

Tiny zero dependency helper module for adding classes to elements.

This emulates jQuery's `addClass` behaviour: it works for multiple elements, can take a space delimitted String for multiple classes, won't add duplicate classes, and even works in awful browsers.

```javascript
addClass(elements, 'class-1 class-2 class-3');
```

## Installation and usage

Grab from NPM

```
npm install element-addclass
```

And import it

```javascript
import addClass from 'element-addclass';
```

Or grab the minified JavaScript from unpkg

```html
<script src="https://unpkg.com/element-addclass"></script>
```

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