if($('#error-email-id').val() === '' ||
($("#error-email-id").val()) === 'Please enter email ID' ||
(!filter.test($("#error-email-id").val())) )
{
here I want that the the value in the field remains "Please Enter email id". But When I enter wrong id say "afafaf.com" then after validating it remains "afafaf.com" But I want if it fails the validation it should be "Please Enter email id"
return false;
}
You can set the value using
.val(value)method