Skip to content

Instantly share code, notes, and snippets.

@midnai
Last active August 29, 2015 14:07
Show Gist options
  • Save midnai/72089cd11e6e818b2e29 to your computer and use it in GitHub Desktop.
Save midnai/72089cd11e6e818b2e29 to your computer and use it in GitHub Desktop.
// in your javascript file ...
$(document).ready(function() {
$('#send').click(function(){
if($("#email").val().indexOf('@', 0) == -1 || $("#email").val().indexOf('.', 0) == -1) {
alert('El correo electrónico introducido no es correcto.');
return false;
}
alert('El email introducido es correcto.');
});
});
// in your html file ...
<input type="text" name="email" id="email" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment