$("#switch").bootstrapSwitch({ state: true, //setting switch current state/value onSwitchChange: function(e, state) { console.log(state); } });