oopros,
<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
$(".validate").on('input',function() {
var email = $.trim(this.value), $span = $(this).next();
if (email) {
if (isValidEmailAddress(email)) {
$span.css({
"background-image": "url('images/validyes.png')"
});
} else {
$span.css({
"background-image": "url('images/validno.png')"
});
}
} else {
$span.css({
"background-image": "none"
});
}
});
});
function isValidEmailAddress(emailAddress) {
var pattern = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);
return pattern.test(emailAddress);
}
</script>
</head>
<body>
<input type='text' name='email[1]' class='validate' ><span></span>
<input type='text' name='email[2]' class='validate' ><span></span>
<input type='text' name='email[3]' class='validate' ><span></span>
</body>
</html>