$(document).ready(function() {

$('.required').parents('tr').children().click(function() {
$(this).parents('tr').find('.required').removeClass();
});

$('.invalid').parents('tr').children().click(function() {
$(this).parents('tr').find('.error').removeClass();
});

});