Class RadioButton

A radio button widget with standard styling.

Index

Methods

build

  • build(): HTMLElement

getElement

  • getElement(): HTMLElement

getLabel

  • getLabel(): HTMLLabelElement

getRadio

  • getRadio(): HTMLInputElement

isSelected

  • isSelected(): boolean
  • Indicates whether the radio button is selected.

    Returns boolean

    true if the radio button is selected, false otherwise.

reset

  • reset(): void

select

  • select(triggerChange?: boolean): void
  • Select the radio button

    Parameters

    • Default value triggerChange: boolean = true

      will trigger change event if specified and the radio button is not already selected

    Returns void

Constructors

constructor

  • new RadioButton(onChange?: function, label: string, name: string, id?: string): RadioButton
  • Creates a new RadioButton.

    Parameters

    • Default value onChange: function = (radioButton: RadioButton) => {}

      The function to call when the radio button value changes. This function takes the current RadioButton instance as an argument.

    • label: string

      The label to display next to the radio button.

    • name: string

      The value to set the input HTMLElement name attribute to.

    • Default value id: string = label

    Returns RadioButton

Hierarchy

  • RadioButton

Implements

  • IFormWidgetWithLabel
  • IFormWidgetSelectable