Bootstrap switch checked event?

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

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

css



        
9条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-31 15:31

    Try this worked for me

     $('#check').change(function (event) {
        var state = $(this).bootstrapSwitch('state');
        if (state) {
           // true
        } else {
           // false
        }
        event.preventDefault();
    });
    

提交回复
热议问题