$('#option1').change(function(event){ checkAllBoxes(); }); $('#option2').change(function(event){ checkAllBoxes(); }); $('#option3').change(function(event){ checkAllBoxes(); }); $('#option4').change(function(event){ checkAllBoxes(); }); var option1, option2, option3, option4; //set variables in begin setOptions(); function setOptions(){ option1 = $('#option1').is(':checked'); option2 = $('#option2').is(':checked'); option3 = $('#option3').is(':checked'); option4 = $('#option4').is(':checked'); } function checkAllBoxes(){ //get variables to check if 'unchecked' //Only show box when option is unchecked after page load if ( (option1 && !$('#option1').is(':checked')) || (option2 && !$('#option2').is(':checked')) || (option3 && !$('#option3').is(':checked')) || (option4 && !$('#option4').is(':checked')) ){ $('.hiddenbox').addClass('showbox'); } else { $('.hiddenbox').removeClass('showbox'); } }