Email validation using jQuery

后端 未结 30 1893
被撕碎了的回忆
被撕碎了的回忆 2020-11-22 16:52

I\'m new to jQuery and was wondering how to use it to validate email addresses.

30条回答
  •  悲哀的现实
    2020-11-22 17:38

    You can use regular old javascript for that:

    function isEmail(email) {
      var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/;
      return regex.test(email);
    }
    

提交回复
热议问题