Published:
May 04, 2018validate email id using jquery or javascript
function validateEmail(email) {
var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,6})?$/;
return emailReg.test(email);
}
Usage:-
if(validateEmail(emailString)){ alert('Your email is valid'); } else{ alert('Your email is not valid! There should be atleast @ and one dot(.) present in it'); }