- $(function (){
- $('#myselect').click(
- function (){
- jQuery('input[@type=checkbox][name=selectAll]').attr('checked',this.checked);
- })
- })
- <th>
- <input type="checkbox" id="myselect" name="selectAll"/>
- </th>
- <input type="checkbox" id="selectAll" name="selectAll"/>
- <input type="checkbox" id="selectAll" name="selectAll"/>
- <input type="checkbox" id="selectAll" name="selectAll"/>
- <input type="checkbox" id="selectAll" name="selectAll"/>
JQUERY全选
最新推荐文章于 2023-07-05 10:34:09 发布
本文介绍了一个使用jQuery实现的选择操作案例,通过点击一个ID为'myselect'的元素来控制一组复选框的状态同步。具体实现了当点击该元素时,页面上所有名为'selectAll'的复选框状态会跟随变化。
157

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



