TextInputElement
class is used to create a text input element in a user interface.
Constructor
Name | Type | Description |
---|---|---|
elementId | string | This property in constructor accepts the Id for the element |
label | string | This property in constructor accepts the label for input |
Class Usage
How to create an instance of theTextInputElement
class:
TextInputElement
is created with the elementId “1” and the label “Name”.
Key properties and methods
Maximum Lines for Text Input
ThesetMaxLines()
method is used to set the maximum number of lines for a multi-line text input element, while getMaxLines()
is used to retrieve the set value.
For example:
Placeholder Text for the Input Element
ThesetPlaceholder()
method is used to set placeholder text in the input field and getPlaceholder()
is used to retrieve the placeholder text.
For instance:
Default Value of the Input Element
ThesetDefaultValue()
method sets the default value in the text input, while getDefaultValue()
retrieves the default value.
For example:
Example
Below is an example that showcases the creation and manipulation of an instance ofTextElement
: