1, get a single checkbox check (three ways) $ ("Input:checkbox:checked"). val () or $ ("Input:[type= ' checkbox ']:checked"). val (); or $ ("Input:[name= ' ck ']:checked"). Val ();2, get multiple checkbox-checked items $ (' Input:checkbox '). each (function() { if($( This). attr (' checked ') = =true) {alert ($ ( This). Val ()); }});3, set the first checkbox to a check value of $ (' Input:checkbox:first '). attr ("Checked", ' checked '); or $ (' Input:checkbox '). EQ (0). attr ("Checked", ' true ');4, set the last checkbox to a check value of $ (' Input:radio:last '). attr (' checked ', ' checked '); or $ (' Input:radio:last '). attr (' checked ', ' true ');5, set any checkbox based on the index value to a check value of $ (' Input:checkbox). EQ (index value). attr (' checked ', 'true‘), index value =0,1,2 .... or $ (' Input:radio '). Slice attr (' checked ', 'true‘) 6. Select multiple checkboxes and select the 1th and 2nd checkbox$ (' Input:radio '). Slice (0,2). attr (' checked ', 'true‘); 7. Set the checkbox to a value of $ ("Input:checkbox[value=' 1 ']. attr (' checked ', 'true‘); 8, delete value=1 checkbox$ ("Input:checkbox[value=' 1 ']. Remove (); 9, delete the first few checkbox$ ("Input:checkbox"). EQ (index value). Remove (); index value =0,1,2 .... If you delete the 3rd checkbox:$ ("Input: CheckBox "). EQ (2). Remove (), 10, Traverse checkbox$ (' Input:checkbox '). Each (function (index, Domele) {//write code}); 11, select All $ (' Input:checkbox '). each (function () {$ (this). attr (' Checked ', True);}); 12. Deselect all $ (' Input:checkbox '). each (function () {$ (this). attr (' Checked ', False);});
12 Tips Summary of the jquery action check box (checkbox)