Jquery implements the code for implementing the full-selection function, and jquery implements the full-selection code.
It is mainly used to simulate the full selection of tables on some web pages.
<Form> your favorite sports are: <input type = "checkbox" id = "Check" value = "select all/select none"/> select all/select none <br/> <input type = "checkbox" name =" items "value =" "/> football <input type =" checkbox "name =" items "value =" basketball "/> basketball <input type =" checkbox "name =" items "value =" badminton "/> badminton <input type =" checkbox "name =" items "value =" Table Tennis "/> Table Tennis </form>
When we click "select all" or "do not select all", the following checkbox performs the corresponding operation.
In turn, when you select ALL, if any of the following checkboxes is not selected, the Select All/select all button will not be selected.
$ ('[Name = items]: checkbox '). click (function () {var p = $ ('[name = items]: checkbox'); if (p. filter (': checked '). length = p. length) {// alert ("Hello World"); $ ("# Check "). attr ("checked", true);} else {$ ("# Check "). attr ("checked", false );}});
The above jquery implementation code for implementing the all-choice function is all the content shared by the editor. I hope to give you a reference, and I hope you can provide more support to the customer's house.