js改变bootstrap switch的选中与否

2025-05-07 22:21:47
推荐回答(1个)
回答1:

无线开关:

data-off="warning">name="enable" checked>


if(info.WLANConfiguration.Enable=='1')
{//无线打开
$('#wlan_enable_id').bootstrapSwitch('toggleState');
$('#wlan_enable_id').bootstrapSwitch('setState', true);
}else
{//无线关闭
$('#wlan_enable_div').bootstrapSwitch('toggleState');
$('#wlan_enable_div').bootstrapSwitch('setState', false);
}