jQuery – validate email address

Below is the basic functionality to validate the email address:
First  add jQuery to your website then  code that will perform the validation when the submit button is clicked:
function isValidEmailAddress(emailAddress) {
var a = document.getElementById(txtEmail).value;
var filter = /^[a-zA-Z0-9]+[a-zA-Z0-9_.-]+[a-zA-Z0-9_-]+@[a-zA-Z0-9]+[a-zA-Z0-9.-]+[a-zA-Z0-9]+.[a-z]{2,4}$/;
return true;
return false;


Share this nice post:

One thought on “jQuery – validate email address

Comments are closed.