LoginSignup
15
11

More than 5 years have passed since last update.

JavaScript でメールアドレスをバリデーション

Posted at

入力フォームなどで有効なメールアドレス書式となっているかを確認する関数

//引数にテキストをいれる
//正しいメアド書式なら true、間違っていれば false を返す
function checkEmailAddress(str){
    if(str.match(/.+@.+\..+/)==null){
        return false;
    }else{
        return true;
    }
}
15
11
6

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
15
11