标签:
1、全选
1 function selectAll(form){ 2 for (var i = 0; i < form.elements.length; i++) { 3 if (form.elements[i].type=="checkbox") { 4 try{ 5 $(form.elements[i]).check("option", "checked", true); 6 }catch(e){ 7 console.log(e); 8 } 9 } 10 } 11 }
2、反选
1 function AutoSelectList(form) { 2 for (var i = 0; i < form.elements.length; i++) { 3 if (form.elements[i].type=="checkbox") { 4 try{ 5 //icheck 6 var val = $(form.elements[i]).check("option", "checked"); 7 $(form.elements[i]).check("option", "checked", !val); 8 }catch(e){ 9 console.log(e); 10 } 11 } 12 } 13 }
标签:
原文地址:http://www.cnblogs.com/Struts-pring/p/4267519.html