JavaScript Program to Check Whether Given Email is Valid or not Using Regular Expression

Write a JavaScript program to check whether given email is valid or not using Regular Expression.

Source Code
    <title>Check for valid Email</title>
        function validateEmail() 
            var email = document.getElementById("email_id").value;
            if(email.indexOf('@') == -1 || email.indexOf('.') == -1)
                alert("Invalid email. Plz enter valid email");
                alert("Valid email");
<input type="text" id="email_id" /><br/>
<input type="button" value="Validate Email" onclick="validateEmail();"/>