Loading…

How to validate email using jQuery?

By including @ and following the email naming standards, email can be validated using jQuery.

Example

                                        

function validateEmail(sEmail) {
      var filter = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
      if (filter.test(sEmail)) {
          return true;
      } else {
          return false;
      }
}

Suggest An Answer

No suggestions avaliable!

Latest post from JQuery interview questions

Ask Question