$('.input-control').on('focus blur', function(e){ $(this).parent()[(e.type=='focus' && $.trim($(this).val()).length)?'addClass':'removeClass']('input-focused'); });