I use this codes for checkbox checked event but it does not work.
css
You should call the switch-change function like below
$('.switch').on('switch-change', function () {
console.log("inside switchchange");
toggleWeather();
});
If you are seeing to create it dynamically, follow the steps given in the link which was previously posted by me. [ create a radio bootstrap-switch dynamically ]
This is for radio type. For checkbox type you can change the type='checkbox'.
You can refer to the below link for more examples - http://www.bootstrap-switch.org/