Js/jQuery email validation

Using regular expressions

let email = jQuery('.nl-sub-email');
let emailReg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,10})$/;
let errors = 0;

if( ! email.val() || emailReg.test( email.val() ) == false ) {
  email.css('border', '1px solid red');
  email.focus();
  errors = 1;
} else {
  email.css('border', '1px solid transparent');
  errors = 0;
}