Last active
August 29, 2015 13:56
-
-
Save weslley39/9094866 to your computer and use it in GitHub Desktop.
Verify is the key pressed is a number, if not, deletes the word
This file contains hidden or 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
function isNumberKey(evt) { | |
var charCode = (evt.which) ? evt.which : event.keyCode; | |
if (charCode > 31 && (charCode < 48 || charCode > 57)) | |
return false; | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment