Bootstrap switch checked event?

前端 未结 9 1703
感情败类
感情败类 2021-01-31 14:48

I use this codes for checkbox checked event but it does not work.

css



        
9条回答
  •  你的背包
    2021-01-31 15:33

    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/

提交回复
热议问题