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}$/; if(filter.test(a)){ return true; } else{ return false; } };