how to add css class to check dynamically

how to add css class to check dynamically

Hi, I am trying to add CSS class to a disabled checkbox when clicking a button. Here is the code, but it doesn't work, please help.

  1. <style>
  2. .input[ type= "checkbox"] :disabled +  label{
         outline: 5px  solid  red
         background-color: red;
      }
  3. </style>
  4. <script>
  5. .input[ type= "checkbox"] :disabled +  label{
         outline: 5px  solid  red
         background-color: red;
      }
  6. </script>