title: JavaScript Validation for top level domain of email address
body: <p>I am trying to create some JavaScript validation to only allow the input of a top level domain of an email address. e.g.(@gmail.com)</p>
  
  <p>I have used the snippet below to try and form validation around the input, however it still allows full email addresses to be input. e.g. (mark@gmail.com)</p>
  
  <pre><code>function isEmailDomain(emailDomainVar) {
    var regEmail = new RegExp('@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/');
    return regEmail.test(emailDomainVar);
  }
  </code></pre>
  
  <p>Thanks in advance for any input on this issue!</p>