disable/enable checkbox by checking “checked” using jquery css selector patterns

 
       $(document).ready(function(){

           $('input[type="checkbox"]').click(function(){

               var countChecked = $("input[id*='att']:checked").length;
               var checkedList = $("input[id*='att']:checked");

                $("input[id*='prb']").prop("disabled",false);

                $.each( checkedList , function(k,v){
                    
                    var idCheck = v.id.replace("att","prb");
                    $("input[id="+idCheck+"]").prop("checked",false);
                    $("input[id="+idCheck+"]").prop("disabled",true);

                });

               if( countChecked == 8 ) {
                   // for checking either its checked or not.
                   //if( $("input[id*='att_apply_form']").prop("checked") == true ) // statements ..
                   
                   // disabling/anabling the checkbox.  
                   $("input[id*='prb']").prop("checked",false);
                   $("input[id*='prb']").prop("disabled",true);

                }
                else{
                   $("input[id*='prb']").prop("disabled",false);
               }

            });


            //alert('yo');

        });