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 optional
target : Object optional

Object to bind to

record : Object optional

Deprecated; use target instead

attribute : string optional

Attribute of the Object to bind to

dump : function optional

transform textContent to value on change

load : function optional

transform 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.)

options : Object optional

see Input constructor options

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.)

options : Object optional

see Input constructor options

Returns

Input

the Input instance