Class: Toggler

components~Toggler(formElementId, callback, togglerParametersopt, optionsopt)

A toggler switch that allows to enable and disable a form element.

Constructor

new Toggler(formElementId, callback, togglerParametersopt, optionsopt)

Parameters:
Name Type Attributes Default Description
formElementId string

The id of the form element.

callback function

The callback function for the click DOM event generated by the toggler.

togglerParameters object <optional>
{}

The parameters to initialize the toggler.

Properties
Name Type Attributes Default Description
disabled boolean <optional>
false

Flag indicating whether the toggler should be disabled at initialization.

initOff boolean <optional>
false

Flag indicating whether the toggler should be initialized in "off" state.

options object <optional>
{}

Parameters considered to generate the component.

Properties
Name Type Attributes Description
bootstrap string <optional>

If given, it indicates the Bootstrap version which the component should be built for.

Implements:
Source:

Members

domElement :HTMLDivElement

Reference to the DOM object that contains the HTML structure of the component.

Type:
  • HTMLDivElement
Implements:
Source:

input :HTMLInputElement

Reference to the DOM object representing the <input> element handled by the toggler.

Type:
  • HTMLInputElement
Source:

Methods

disable()

Disables the component.

Implements:
Source:

enable()

Enables the component.

Implements:
Source: