# associated

> Get associated labels and inputs

Latest version **0.8.0** (published 2017-02-16) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.8.0 |
| Published | 2017-02-16 |
| First published | 2016-11-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Ryan Van Etten |
| Maintainers | ryanve |
| Keywords | ui, dom, input, inputs, radios, labels, label, browser, traversal, ender, plugin, jquery, jquery-plugin, controls, form-control, forms, form |

## Links

- npm: https://www.npmjs.com/package/associated
- Repository: https://github.com/ryanve/associated
- Issues: https://github.com/ryanve/associated/issues
- npm.io page: https://npm.io/package/associated

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.8.0 (latest) — 2017-02-16
- 0.7.0 — 2017-02-16
- 0.6.1 — 2017-02-15
- 0.6.0 — 2017-02-15
- 0.5.3 — 2017-02-15
- 0.5.2 — 2017-02-15
- 0.5.1 — 2017-02-15
- 0.5.0 — 2017-02-15
- 0.4.0 — 2016-12-09
- 0.3.0 — 2016-12-08
- 0.2.0 — 2016-12-08
- 0.1.0 — 2016-11-15

## README

# associated

```
npm install associated --save
```

## Features
- Get label(s) for a specified input
- Get form control (input, textarea, select, button) for a specified label
- Get associated form
- Get associated radios

## API

```js
var associated = require('associated')
```

### Parameters

- `$form` refers to a jQuery-wrapped `<form>` element
- `$root` refers to a jQuery-wrapped `:root` element
- `$input` refers to a jQuery-wrapped `<input>` element
- `$textarea` refers to a jQuery-wrapped `<textarea>` element
- `$select` refers to a jQuery-wrapped `<select>` element
- `$button` refers to a jQuery-wrapped `<button>` element
- `$control` refers to a jQuery-wrapped form control: `$input`, `$textarea`, `$select`, or `$button`
- `$label` refers to a jQuery-wrapped `<label>` element
- `$labels` refers to a jQuery-wrapped `<label>` collection
- `$radio` refers to a jQuery-wrapped radio input
- `$radios` refers to a jQuery-wrapped radio input collection

### Methods

#### `associated.control($label)`
- Get `$control` associated with `$label`

#### `associated.input($label)`
- Get `$input` associated with `$label`

#### `associated.textarea($label)`
- Get `$textarea` associated with `$label`

#### `associated.select($label)`
- Get `$select` associated with `$label`

#### `associated.button($label)`
- Get `$button` associated with `$label`

#### `associated.label($control)`
- Get the `$label` associated with `$control`

#### `associated.labels($control)`
- Get all `$labels` associated with `$control`

#### `associated.form($control)`
- Get associated `$form` or else `$root`

#### `associated.radios($radio)`
- Get `$radios` associated by `[name]`

### Chaining

#### Setup `associated` for use as plugin for jQuery or ender
```js
$.prototype.associated = associated
```

#### Then use `.associated` to call [methods](#methods) from the chain like
```js
$('#example').associated('form')
```

## Links
- [`associated` npm](https://www.npmjs.com/package/associated)
- [`associated` tests](https://ryanve.github.io/associated/)

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