Jquery 如何在引导是否开关按钮中获取值或设置值

Jquery 如何在引导是否开关按钮中获取值或设置值,jquery,twitter-bootstrap,Jquery,Twitter Bootstrap,在引导式是非开关按钮中,如何设置值。如果是,则表示正确;如果否,则表示错误 <label class="pull-right inline"> <small class="muted smaller-90"></small> <input id="id-Kitchen" checked="" type="checkbox" class="ace ace-switch ace-switch-5" /> <span class="lb

在引导式是非开关按钮中,如何设置值。如果是,则表示正确;如果否,则表示错误

<label class="pull-right inline">
  <small class="muted smaller-90"></small>
  <input id="id-Kitchen" checked="" type="checkbox" class="ace ace-switch ace-switch-5" />
  <span class="lbl middle"></span>
</label>

 $('#id-Kitchen').attr('checked', 'checked').on('click', function () {
    alert('asd');
    $('#default-buttons .btn').toggleClass('no-border');
 });

$('#id Kitchen').attr('checked','checked').on('click',function(){
警报(“asd”);
$('#default buttons.btn').toggleClass('no-border');
});

使用Javascript这就是您要做的

$('#id-Kitchen').on('click', function () {
    alert($(this).prop('checked'));
});

这将取决于您使用的插件。我看到您正在使用一个名为
ace
?我使用Bootstrap开关,文档很简单。