$("input.email").change(function() {
var emailVal = $("input.email").val();
var regex = new RegExp("^[-._a-z0-9]+@(?:[a-z0-9][-a-z0-9]+\.)+[a-z]{2,6}$");
if(regex.test(emailVal)){
$("input.email").removeClass('error');
} else{
$("input.email").val('');
$("input.email").addClass('error');
}
});