No need javascript. In HTML5, you can use <input type="email"> to define a text field that should contain an email address and will automatically validate that the entry is of valid email format when the form is submitted. In addition, you can add a "required" attribute to reject empty input.
<input type="email" id="email" name="email" placeholder="someone@gmail.com" required>
Read more from:
Beginner's Guide to HTML5 & CSS3 - Formidable Forms with HTML5[
^]