How can I validate an email address in JavaScript?

asked18 years ago
last updated4 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?