Here is example for validating user email id using jquery
HTML
HTML
<input type="text" id="email"></input>
<input type="button" value="test" id="click"/>
jQuery
$("#click").click(function (e) {
var emailReg = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;;
if( !emailReg.test( $("#email").val() ) ) {
alert("Invalid email id");
return false;
} else {
alert("Valid email id");
return true;
}
});