读书人

jquery 兑现checkbox全选

发布时间: 2012-06-28 15:20:03 作者: rapoo

jquery 实现checkbox全选

<script type="text/javascript">
??? ??????????? function selectAll(checkbox) {
??? ??????????????? $('input[type=checkbox]').attr('checked',?? $(checkbox).attr('checked'));
??? ??????????? }
?</script>

?

?

<input type="checkbox" onclick="selectAll(this);" />全选

<input type="checkbox"? /><input type="checkbox"? /><input type="checkbox"? /><input type="checkbox"? /><input type="checkbox"? /><input type="checkbox"? />

读书人网 >Web前端

热点推荐