Methods
In Bootstrap Switch, every option is also a method.
If the second parameter is omitted, the method returns the current value.
You can invoke methods as follows:
$('input[name="my-checkbox"]').bootstrapSwitch('state', true, true);
Additional Methods
Name | Description |
---|---|
toggleState | Toggle the switch state |
toggleAnimate | Toggle the animate option |
toggleDisabled | Toggle the disabled state |
toggleReadonly | Toggle the readonly state |
toggleIndeterminate | Toggle the indeterminate state |
toggleInverse | Toggle the inverse option |
destroy | Destroy the instance of Bootstrap Switch |
Special Behaviours
- The method
state
can receive an optional third parameterskip
. if true,switchChange
event is not executed. The default is false. - The method
toggleState
can receive an optional second parameterskip
. if true,switchChange
event is not executed. The default is false. - The method
wrapperClass
can accept a falsy value as second parameter. If so, it resets the class to its default.