1.0.0 • Published 8 years ago
@f/form-controls v1.0.0
form-controls
Retrieve a list of control elements from a form
Installation
$ npm install @f/form-controls
Usage
var controls = require('@f/form-controls')
function serialize (form) {
return controls
.reduce(function (acc, ctrl) {
acc[ctrl.name] = ctrl.value
return acc
}, {})
}
API
formControls(form)
form
- An HTMLFormElement.
Returns: An array of input controls within form
.
License
MIT
1.0.0
8 years ago