Last active
December 25, 2015 07:49
-
-
Save Kcko/6941782 to your computer and use it in GitHub Desktop.
JavaScript: only num in input
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
<input onkeypress="return !isNaN(String.fromCharCode(event.charCode || event.keyCode))"> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment