How can I validate an email address in JavaScript?

asked17 years ago
last updated3 years ago
viewed4.4m times
Up Vote5.5kDown Vote

I'd like to check if the user input is an email address in JavaScript, before sending it to a server or attempting to send an email to it, to prevent the most basic mistyping. How could I achieve this?