title: How to prevent Jquery append more than once
body: <p>I have some jQuery that checks if the user inputted a correct email address. The user can then go back and change his/her email if it is not valid. However, my code will result in the same error messege twice because the error keeps getting appended inside my <code>errors</code> div. How can I change this to only allow the error to be appended once? I also would like to remove the error if the <code>email</code> variable is <code>true</code>. There are also other validation errors being placed in this div.</p>
  
  <p>jQuery:</p>
  
  <pre><code>var email = $('#email').val();
  email = validateEmail(email);
  if (email = "false") {
      $('#errors').append("&lt;p&gt;Please enter a valid email&lt;/p&gt;");
  }
  </code></pre>
  
  <p><code>validateEmail</code> will return either <code>true</code> or <code>false</code> depending on whether the email is valid.</p>