Input
A generator for an input element that binds the value of the input to an object. This is not an element, but a generator that adds listeners to an input element. If one day, Safari adds support for extending built-in elements, this can be converted.
Example
JS
Input.create('number', {})
// <input ...>
Input.new('number', {})
// Input()Constructor
new Input(options)
options
:
Object
optionaltarget
:
Object
optionalObject to bind to
record
:
Object
optionalDeprecated; use target instead
attribute
:
string
optionalAttribute of the Object to bind to
dump
:
function
optionaltransform textContent to value on change
load
:
function
optionaltransform value for input's content
Static Methods
Create a bound input and return the DOM element
Parameters
type
:
string
input type (text, number, checkbox, select, date, textarea, button, etc.)
Returns
HTMLElement
the created input element
Create and return an Input instance (access the element via .input)
Parameters
type
:
string
input type (text, number, checkbox, select, date, textarea, button, etc.)
Returns
Input
the Input instance