You can use the .is(':checked') method which returns true if an element is checked, otherwise it returns false.
Working example
Using .is(':checked') method and a conditional statement to change the background-color
$('input').on('click', function(){ isChecked = $(this).is(':checked') if(isChecked){ $('html').css('background-color','green') } else{ $('html').removeAttr('style') } }) <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <label><input type="checkbox"> Try me </label>