how to remove error text from the email format checker code?
<p>I have been writing a code for validating forms using javascript/jquery. Following is a code snippet for checking email format. The problem is when I enter invalid email, it recognizes it, but when I go back to this field and enter correct email, the error text still stays even though I have used the 'else' part. How do I remove the error text in this case?</p>

<pre><code>if(e1.value!=''){
    var emailRegEx = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i;
    if (document.signupForm.email1.value.search(emailRegEx) == -1) {
        $("#err_email1").html("Please enter valid email address.");
    }
    status=0;         
}
else{
    $("#err_email1").html("");
    status=1;
}
</code></pre>
