var search_str = /^[\w\-\.]+@[\w\-\.]+(\.\w+)+$/; var email_val = $("#Email").val(); if(!search_str.test(email_val)){ alert("please input right email !"); $('#Email').focus(); return false; }