<input type="checkbox" id="allcheck"/>全选</br>
<input type="checkbox"/>苹果</br>
<input type="checkbox"/>西瓜</br>
<input type="checkbox"/>香蕉</br>
<input type="checkbox"/>橘子</br> $(function(){
$('#allcheck').click(function(){
$('input[type=checkbox]').attr('checked',this.checked);
});
});
本文介绍如何通过JavaScript实现全选按钮的功能,当点击全选按钮时,可以批量改变网页上所有复选框的选中状态。适用于网页表单、购物车等需要批量操作的场景。
1736

被折叠的 条评论
为什么被折叠?



