jQuery().ready(function() { $('.parts.quick-quotation .part input.error').focus(function() { $(this).removeClass('error'); }); $('.step-2 .part input.input.error[type="text"]').focus(function() { if($(this).hasClass('error')) { $(this).removeClass('error'); $(this).val(''); } }); });