Skip to main content
The RadioButtonElement class is designed to create a radio button input element in a user interface.

Constructor

Class Usage

Here’s how to create an instance of the RadioButtonElement class:
In this example, a new instance of RadioButtonElement is created with an elementId “1”, a label “Choose an option”, and a list of two options.

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:

Example

Here is an example that showcases the creation and manipulation of an instance of RadioButtonElement: