jquery实现反选、全选、全不选功能
2017-12-26 15:10
330 查看
效果图如下
代码
代码
<!DOCTYPE html> <html> <head> <title></title> <script type="text/javascript" src="jquery-3.2.1.js"></script> <script type="text/javascript"> function allof() { $("input").prop("checked",true); } function allnot() { $("input").prop("checked",false); } function other() { $("input[name='hobby']").each(function(){ $(this).prop("checked",$(this).prop("checked")?false:true); }); } </script> </head> <body> <input type="checkbox" name="hobby" value="a"> A <hr> <input type="checkbox" name="hobby" value="b"> B <hr> <input type="checkbox" name="hobby" value="c"> C <hr> <input type="checkbox" name="hobby" value="d"> D <hr> <input type="checkbox" name="hobby" value="e"> E <hr> <input type="checkbox" name="hobby" value="f"> F <hr> <button onclick="allof()">全选</button> <button onclick="other()">反选</button> <button onclick="allnot()">全不选</button> </body> </html>
相关文章推荐
- jQuery实现的全选、反选和不选功能
- jquery 实现checkbox全选,反选,全不选等功能代码(奇数)
- Jquery之实现全选反选功能
- jQuery实现表格与ckeckbox的全选与单选功能
- jquery实现简单的全选和反选功能
- jQuery实现全选、反选和不选功能
- jquery实现全选,取消,反选的功能&实现左侧菜单
- jquery实现全选反选功能---兰
- js和jQuery实现获取id和点击checkbox全选功能
- JQuery实现checkbox的全选/取消全选,实现类似于邮箱功能
- jQuery实现的全选、反选和不选功能
- 基于jQuery实现复选框的全选 全不选 反选功能
- Jquery 实现全选反选功能
- jQuery实现的全选、反选和不选功能
- jQuery 实现 Checkbox 的全选、全不选和反向选择的功能
- jquery实现全选和全不选功能
- jQuery实现的全选、反选和不选功能
- jQuery实现全选功能
- jquery实现全选功能效果的实现代码
- jquery实现checkbox的全选跟取消功能