0.8.0 • Published 9 years ago
associated v0.8.0
associated
npm install associated --saveFeatures
- 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
var associated = require('associated')Parameters
$formrefers to a jQuery-wrapped<form>element$rootrefers to a jQuery-wrapped:rootelement$inputrefers to a jQuery-wrapped<input>element$textarearefers to a jQuery-wrapped<textarea>element$selectrefers to a jQuery-wrapped<select>element$buttonrefers to a jQuery-wrapped<button>element$controlrefers to a jQuery-wrapped form control:$input,$textarea,$select, or$button$labelrefers to a jQuery-wrapped<label>element$labelsrefers to a jQuery-wrapped<label>collection$radiorefers to a jQuery-wrapped radio input$radiosrefers to a jQuery-wrapped radio input collection
Methods
associated.control($label)
- Get
$controlassociated with$label
associated.input($label)
- Get
$inputassociated with$label
associated.textarea($label)
- Get
$textareaassociated with$label
associated.select($label)
- Get
$selectassociated with$label
associated.button($label)
- Get
$buttonassociated with$label
associated.label($control)
- Get the
$labelassociated with$control
associated.labels($control)
- Get all
$labelsassociated with$control
associated.form($control)
- Get associated
$formor else$root
associated.radios($radio)
- Get
$radiosassociated by[name]
Chaining
Setup associated for use as plugin for jQuery or ender
$.prototype.associated = associatedThen use .associated to call methods from the chain like
$('#example').associated('form')