Design comparison
SolutionDesign
Solution retrospective
What is the best way to validate email ? if I checked for '@' and '.' is this enough?
Community feedback
- @tlcheah2Posted almost 5 years ago
Hi Ghadeer,
You can actually google it out and there is a lot of custom pattern for validating email. However, you can use the default HTML5 email validation by specifying your input type="email".
For e.g,
const inputEmail = document.getElementById('input-email'); const isValidEmail = inputEmail.checkValidity();
That's how I do for email validation.
I am not sure is that what you asked for. I hope it helps.
Thanks
2
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord