title: Live email validation in javascript
body: <p>I want the javascript to check the email live when I'm typing in the textbox. Nothing happens.</p>
  
  <p>This is my code:</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;form action="#" method="post" autocomplete="off"&gt;
          &lt;div class="formulier"&gt;
  
              &lt;label for="email"&gt;Email:&lt;/label&gt;
              &lt;input type="text" id="email" onchange="controle(this.value)"/&gt;
  
              &lt;div class="signup"&gt;
                  &lt;input type="button" value="Ok, Sign up!" /&gt;
              &lt;/div&gt;
  
          &lt;/div&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p><strong>JAVASCRIPT</strong></p>
  
  <pre><code>function controle(mail) {
      if (isEmail(mail.val()) == true)
          {
              alert("good");
          }
  
  }
  
          function IsEmail(email) {
          var regex = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
          if(!regex.test(email)) {
             return false;
          }else{
             return true;
          }
        }
  </code></pre>