我用JQuery時,我試圖檢查所有功能,然後在那裏,因爲這個JS沒有顯示所有選中的字段,但當我刪除那個JS然後滑塊受影響。所以請嘗試解決我的問題,我也沒有使用衝突功能,但它不工作。「檢查所有」不檢查複選框
<script type="text/javascript">
jQuery.noConflict()
jQuery.ready(function() {
jQuery("#selectall").click(function() {
$('.case').attr('checked', this.checked);
}); // prototype
});
</script>
<div class="accordion-heading">
<input type="checkbox" id="selectall" name="sample" class="selectall" />
<div style="float:left; "> <a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#accordion1" href="#collapse_1" /> Admin Module
</div>
</a>
</div>
<div id="collapse_1" class="accordion-body collapse in">
<div class="accordion-inner" id="checkboxlist">
<table class="table table-bordered table-hover" id="test" align="center" style="width:100%">
<tr>
<th width="450"><strong>Form Name</strong>
</th>
<th width="150"><strong>select</strong>
</th>
<th width="150"><strong>Edit</strong> </th>
<th width="150"><strong>Delete</strong>
</th>
<th width="150"><strong>View</strong>
</th>
</tr>
<tr>
<td style="padding-left:20%">Authentication</td>
<td style="padding-left:8%">
<input type="checkbox" id="case1" name="emailid[]" value="" class="case" /> </td>
<td style="padding-left:8%">
<input type="checkbox" id="case1" name="emailid[]" value="" class="case" />
</td>
<td style="padding-left:8%">
<input type="checkbox" id="case1" name="emailid[]" value="" class="case" /> </td>
<td style="padding-left:8%">
<input type="checkbox" id="case1" name="emailid[]" value="" class="case" />
</td>
</tr>
什麼是你的問題? – 2014-10-17 08:08:04
衝突java腳本 – Mahesh 2014-10-17 08:08:57
可能的重複[如何使用jQuery檢查複選框?](http://stackoverflow.com/questions/426258/how-do-i-check-a-checkbox-with-jquery) – OIS 2014-10-17 08:10:34