Validate email address textbox using JavaScript
<p>I have requirement i.e validating entered email address when user comeout from the textbox.
I have googled for this but i got form validatation jscript i don't want form validatation.
I want textbox validatation i have writen below jscript but "if email invalid it's not returning the same page" </p>

<pre><code> function validate(email) {

            var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
            //var address = document.getElementById[email].value;
            if (reg.test(email) == false) 
            {
                alert('Invalid Email Address');
                return (false);
            }
 }
</code></pre>
