input-data-dirty
v1.0.3
Published
InputDataDirty - controls [inputs, select, textarea] for having any value.
Downloads
3
Readme
InputDataDirty
JavaScript tiny lib to control whether [inputs, select, textarea] has any value.
Toggles true / false
value on data-dirty
attribute.
The only dependency is jquery
Install
npm install input-data-dirty
Import
import InputDataDirty from 'input-data-dirty'
Usage
Case 1 "Adding attribute"
Run init()
without options
InputDataDirty.init()
And add data-dirty
attribute to [inputs, select, textarea] you want to control
<input data-dirty>
Case 2 "Control it all"
Run init.()
with controlAll
flag
InputDataDirty.init({
controlAll: true
})