jQuery(function() { if(jQuery('#newCustomer').length > 0 && jQuery('#existingCustomer').length > 0) { jQuery('#newCustomer, #existingCustomer').css('cursor', 'pointer').click(function() { jQuery(this).next().slideToggle(); }).next().hide(); } });