- //<input type='checkbox' name='id' value='11'/>
- //全选
- function select_all(){
- $("input[name='id']").attr("checked", true);
- }
- //全不选
- function unselect_all(){
- $("input[name='id']").attr("checked", false);
- }
- //反向选择
- function select_other(){
- jQuery.each($("input[name='id']"), function(i, n){
- n.checked = !n.checked;
- });
- }
- //该片段来自于http://www.codesnippet.cn/detail/050120131308.html
来源: http://www.codesnippet.cn/detail/050120131308.html