DropdownElement
class is used to create a dropdown selection element in a user interface.
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 dropDown |
options | Array<OptionElement> | This property in constructor accepts options for dropDown |
DropdownElement
class:
DropdownElement
is created with an elementId “1”, a label “Choose an option”, and a list of two options.
setDefaultValue()
method sets the default value in the dropdown input, while the getDefaultValue()
retrieves it.
For example:
DropdownElement
: