Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to only accept email in the format of name@domain.com js

// It's easy
const email = "123@123.com"

function ValidateEmail(mail) {
    if (/^w+([.-]?w+)*@w+([.-]?w+)*(.w{2,3})+$/.test(mail)) {
      console.log("It's a valid email!")
    }else{
      console.log("Not a valid email :(")
    }
  }

  ValidateEmail(email);
 
PREVIOUS NEXT
Tagged: #accept #email #format #js
ADD COMMENT
Topic
Name
5+5 =