Constructor
| Name | Type | Description |
|---|---|---|
| elementId | string | Accepts the ID for the element in the constructor |
| label | string | Accepts the label for radio in the constructor |
| options | Array<OptionElement> | Accepts options for radio in the constructor |
Class Usage
Here’s how to create an instance of the RadioButtonElement class:- TypeScript
Key Properties and Methods
Default Value of the Input Element
The setDefaultValue() method sets the default value in the radio button input, while the getDefaultValue() retrieves it. For example:- TypeScript
Example
Here is an example that showcases the creation and manipulation of an instance of RadioButtonElement:- TypeScript