This state changes, but the color of the button is needed.

$("#old").change(function(){ $("#but").attr('disabled', this.checked); }); 
 <script src="https://code.jquery.com/jquery-3.0.0.min.js"></script> <input type="checkbox" id="old" >go <button id="but">Нажать</button> 

    1 answer 1

    toggleclass

     $("#old").change(function(){ $("#but").toggleClass('active'); }); 
     .active { background: #FF0000; } 
     <script src="https://code.jquery.com/jquery-3.0.0.min.js"></script> <input type="checkbox" id="old" >go <button id="but">Нажать</button> 

    • Thank you very much! I will go on to learn Javascript. - Proshka pm
    • @Alex, I recommend Learn.JavaScript.Ru . - Roman Grinyov pm
    • Thank. There are such plugs - there’s no way to understand how this or that function works - you have to sort it out for hours - Proshka