How to validate email using jquery

    To validate email using jquery you can use following script
    $(document).ready(function() {
    $('#comment-submit').click(function() {
        var emailaddress = $('#comment-email').val();
        var emailexp = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
                if (emailaddress == '')  {
                  alert('Please enter email.');
                  $('#comment-email').focus();
                  return false;
                }
                else if(!emailexp.test(emailaddress)) {
                  alert('Please enter valid email address.');
                  $('#comment-email').focus();
                  return false;
                 }
                 else {
                   return true;
                 }
             });
    });
    where "#comment-submit" is id of button when it is clicked email text box "#comment-email" will be validated first before submission
    5
    Average: 5 (1 vote)