Email Validation using JavaScript Regular Expression

Even now and then we need to add email validation on our forms. The following block of code provides you a way to perform email validation using JavaScript regular expressions. <script> var email1 = '[email protected]'; if(validateEmail(email1)) alert('Validated1 : '+email1); else alert("Invalid email id1 : "+email1); var email2 = '[email protected]'; if(validateEmail(email2)) alert('Validated2 : '+email2); else alert("Invalid…