Created
September 28, 2012 14:14
-
-
Save guilhermehn/3800124 to your computer and use it in GitHub Desktop.
JavaScript: Campo numérico (jQuery)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(".numerico").keypress(function(e){ | |
var charcode = e.keyCode ? e.keyCode : e.which; | |
if(charcode < 48 || charcode > 57){ | |
e.preventDefault(); | |
return false; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment