title: How to assign a value to a variable in JQUERY
body: <pre><code>if($('#error-email-id').val() === '' || 
    ($("#error-email-id").val()) === 'Please enter email ID' || 
    (!filter.test($("#error-email-id").val())) )
  
  {
  </code></pre>
  
  <p>here I want that the the value in the field remains <code>"Please Enter email id"</code>. But When I enter wrong id say <code>"afafaf.com"</code> then after validating it remains <code>"afafaf.com"</code> But I want if it fails the validation it should be <code>"Please Enter email id"</code></p>
  
  <pre><code> return false;
  }
  </code></pre>