set state to bootstrap switch code example
Example 1: how to assign bootstrapswitch using jquery
<form class="form-horizontal">
<div class="form-group">
<label class="control-label" for="inputEmail">Email</label>
<input type="text" id="inputEmail" placeholder="Email">
</div>
<div class="form-group">
<label class="control-label" for="notification1">Notification 1</label>
<input id="notification1" type="checkbox">
</div>
<div class="form-group">
<label class="control-label" for="notification2">Notification 2</label>
<input id="notification2" type="checkbox">
</div>
<div class="form-actions">
<button type="reset" class="btn btn-inverse">Reset</button>
</div>
</form>
Example 2: how to assign bootstrapswitch using jquery
$('#toggle-state-switch').bootstrapSwitch('state');
$('#toggle-state-switch').bootstrapSwitch('state', false);
$('#toggle-state-switch').bootstrapSwitch('state', false, false);
$('#toggle-state-switch').bootstrapSwitch('toggleState');
$('#toggle-state-switch').bootstrapSwitch('toggleState');