< xmlns = 'http://www.w3.org/1999/xhtml' xml:lang = 'en'> <head> <meta http-equiv = 'content-type' content = 'text/html; charset = utf-8 '/> <meta http-equiv =' content-language 'content =' en-us '/> <title>チェックボックスSelect </title> <script>' text/javascript 'src =' jquery-3.0.0.js '> </script> <スクリプトタイプ='テキスト/javascript '' > $(document).ready(function(){/**** ---全选---- **** /// $( '#check1')。on( 'change'、function(){// $( "#check1")。 // if(this.checked == true){$( 'input')。prop( 'checked'、true);} else {$( 'input')。 } //方法二//$('input [Type=Checkbox] /**** ---第一列---- ****/$( '#checkl1')。on( 'click'、function(){// k41、#check51 ')。prop(' checked '、true);} else {$('#check11、#check21、#check31、#check41、#check51 ')。prop(' checked '、false);} //如上});/**** ----第二列---- ****/$( '#checkl2') heck42、#check52 ')如上});/**** ----第三列---- ****/$( '#checkl3') heck43、#check53 ')如上});/**** ----第四列---- ****/$( '#checkl4') heck44、#check54 ')如上});/**** ----第一行---- ****/$( '#checkh1') heck13、#check14 ')如上});/**** ----第二行---- ****/$( '#checkh2') heck23、#check24 ')如上});/**** ----第三行---- ****/$( '#checkh3') heck33、#check34 ')如上});/**** ----第四行---- ****/$( '#checkh4') heck43、#check44 ')如上});/**** ----第五行---- ****/$( '#checkh5') heck53、#check54 ') }});} type = "Checkbox" id = "checkl2"/> <label for = "checkl2">第二列</label> </td> <td> <入力タイプ= "Checkl3"/> <label for = "checkl3">第三列</label> </td> <td> <入力タイプ= "チェックボックス"/<ラベルfor = "checkl4">第四列</label> </td> </tr> <tr> <td> <入力タイプ= "checkbox" id "checkh1"/> <label for = "checkh1">第一行</label> </td> <td> <inputタイプ= "チェックボックス" id = "check11"/> </td <input = "checkbox" /> </td> <td> <入力タイプ= "チェックボックス" id "check13"/> </td> <td> <input type = "checkbox" id = "check14"/> </td> </tr <tr> <td> <入力タイプ= "チェックボックス" id = "check2"/> <ラベル= < type = "Checkbox" id = "check21"/> </td> <td> <input type = "Checkbox" check22 "/> </td> <td> <input Type =" Checkbox "Id =" check23 "/> </td> <td> <td> <input Type =" checkbox "id =" check24 "/> </td> <td <td> <td> <td>>>>>> < = "checkh3"/> <label for = "checkh3">第三行</label> </td> <td> <input type = "checkbox" id "check31"/> </td> <td> <入力タイプ "チェックボックス" id = "check32"/> </td> <td> <入力= "" id = "" id = <td> </td> type = "Checkbox" id = "check34"/> </td> </tr> <tr> <td> <input Type = "Checkbox" Id "checkh4"/> <label for = "checkh4">第四行</label> </td> <td> <inputタイプ= "チェックボックス" id = "check41"/> </td> <input = "ID =" ID = "ID =" ID = "ID =" ID = "ID = /> </td> <td> <入力タイプ= "チェックボックス" id = "check43"/> </td> <td> <input type = "checkbox" id = "check44"/> </td> </tr> <tr> <td> <inputタイプ= "チェックボックス" id = "checkh5"/> <inucth5 "> </td> < type = "Checkbox" Id = "Check51" /> < /td> <td> <input Type = "Checkbox" check52 " /> < /td> <td> <input Type =" Checkbox "Id" check53 " /> < /td> <td> <td> <input Type =" Checkbox "=" check54 "" /> </td> </tr> </tbody> </table> </body> </html>效果图
以上所述是小编给大家介绍的チェックボックス选中一个另一个チェックボックス也会选中的实现代码的全部叙述、希望对大家有所帮助、如果大家想了解更多内容敬请关注武林网!