Ad Code

Javascript valid email address code

<input type="text" name="email" value="" onblur="isValidEmail(this.value)"/>

<script>

function isValidEmail(email) {
 var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/;
 return regex.test(email);
}

//var email = document.getElementById('email').value;

//isValidEmail(email)

</script>

Post a Comment

0 Comments