Jquery 点击父类全选子类 , 子类选父类


<p>
   <label style="font-size:18px;font-weight: bold;" class="checkboxs">
      <input type="checkbox" name="faci_in_checkbox[]" value="56" class="">&nbsp;B超          
   </label>
   <span>
        <label style="margin-left:0px;" class="auth_rules">
           <input type="checkbox" name="faci_in_checkbox[]" value="65" class="">腹部B超
        </label>
       <label style="margin-left:0px;" class="auth_rules"><input type="checkbox" name="faci_in_checkbox[]" value="66">甲状腺B超</label>
       <label class="auth_rules"><input type="checkbox" name="faci_in_checkbox[]" value="76">  的说法士大夫 </label>              
    </span>
</p>

$(".checkboxs").click(function (){
    var is_check = $(this).find('input').get(0).checked; //判断是否选中
    $(this).next().find('input').prop("checked",is_check);
})
$(".auth_rules").click(function (){
   $(this).parent().parent().children('label').find('input').prop('checked','checked')
})

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM