how to assign bootstrapswitch using jquery 1

how to assign bootstrapswitch using jquery

$('#disable-switch').bootstrapSwitch('disabled');
$('#disable-switch').bootstrapSwitch('toggleDisabled');
$('#disable-switch').bootstrapSwitch('disabled', true);  // true || false

$('#readonly-switch').bootstrapSwitch('readonly');
$('#readonly-switch').bootstrapSwitch('toggleReadonly');
$('#readonly-switch').bootstrapSwitch('readonly', true);  // true || false

Here is what the above code is Doing:
1. The first line is initializing the switch. This is required.
2. The second line is setting the state of the switch. This is optional.
3. The third line is toggling the state of the switch. This is optional.
4. The fourth line is setting the state of the switch. This is optional.
5. The fifth line is setting the state of the switch to disabled. This is optional.
6. The sixth line is toggling the disabled state of the switch. This is optional.
7. The seventh line is setting the disabled state of the switch. This is optional.
8. The eighth line is setting the state of the switch to readonly. This is optional.
9. The ninth line is toggling the readonly state of the switch. This is optional.
10. The tenth line is setting the readonly state of the switch. This is optional.

Similar Posts