I\'m new to jQuery and was wondering how to use it to validate email addresses.
If you have a basic form, just make the input type of email:
This will work for browsers that use HTML5 attributes and then you do not even need JS. Just using email validation even with some of the scripts above will not do much since:
some@email.com so@em.co my@fakemail.net
etc... Will all validate as "real" emails. So you would be better off ensuring that the user has to enter their email address twice to make sure that they put the same one in. But to guarantee that the email address is real would be very difficult but very interesting to see if there was a way. But if you are just making sure that it is an email, stick to the HTML5 input.
FIDDLE EXAMPLE
This works in FireFox and Chrome. It may not work in Internet Explorer... But internet explorer sucks. So then there's that...