input type email react js-validation 1

input type email react js-validation

if (/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i.test(email)) {

Here is what the above code is Doing:
1. It’s checking if the email is empty. If it is, it will return false.
2. It’s checking if the email is valid. If it isn’t, it will return false.
3. If the email is valid, it will return true.

Similar Posts