This article is mainly about the implementation of jquery total selection and cancellation of two simple methods are introduced, the need for friends can come to the reference, hope to help everyone else
Use jquery to implement select and deselect all, not JS is so cumbersome, and support more browsers. Code as follows: <mce:script type= "Text/javascript" ><!-- $ (function () { $ ("#checkall"). Click (function () { $ ("input[@name = ' checkname[]"). each (function () { &NB Sp $ (this). attr ("Checked", true); }); }) &N Bsp $ ("#delcheckall"). Click (function () { $ ("input[@name = ' checkname[]"). each (function () { $ (this). attr ("checked", false); &NB Sp }); }); }); //--></mce:script> <input type= ' checkbox ' ID = ' id1 ' name= ' checkname[] ' value= ' 1 '/>value1 <input type= ' checkbox ' id= ' id2 ' name= ' checkname['] ' value= ' 2 '/ >value2 <input type= ' checkbox ' id= ' id3 ' name= ' checkname[] ' value= ' 3 '/>value3 <input type= "button" id= "Checkall" name= "Checkall" value= "Select All"/> <input type= "button" id= "Delcheckall" Name= "Delcheckall" value= "deselect All"/> A simpler: code is as follows: $ ("#checkall"). Click ( function () { if (this.checked) { $ ("Input[name= ' CheckName ')"). attr (' checked ', true) & nbsp }else{ $ ("Input[name= ' CheckName ']"). attr (' checked ', false) } } );