Bootstrap switch checked event?

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

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

css



        
9条回答
  •  滥情空心
    2021-01-31 15:20

    try this

    
    
        $('input[name="my-checkbox"]').on('switchChange.bootstrapSwitch', function (event, state) 
            {
                  if (state == true) 
                   {
                     //your code
                   }
                   else
                   {
                      //your code
                   }
            });
    

提交回复
热议问题