Constructor
new Input(type, placeholder, minLength, maxLength)
Parameters:
Name | Type | Description |
---|---|---|
type |
string | one of HTML input type |
placeholder |
string | |
minLength |
string | number | min number of characters |
maxLength |
string | number | max number of characters |
Classes
Members
value
Gets input value.
value
Sets input value.
Methods
disable() → {Input}
Sets as read-only.
Returns:
this
- Type
- Input
enable() → {Input}
Sets as editable field.
Returns:
this
- Type
- Input
onChange(fun) → {Input}
Binds a function called on change event.
Parameters:
Name | Type | Description |
---|---|---|
fun |
function |
Returns:
this
- Type
- Input
onEnter(fun) → {Input}
Binds a function called when key "Enter" is pressed.
Parameters:
Name | Type | Description |
---|---|---|
fun |
function |
Returns:
this
- Type
- Input
onInput(fun) → {Input}
Binds a function called on input event.
Parameters:
Name | Type | Description |
---|---|---|
fun |
function |
Returns:
this
- Type
- Input