Created
December 14, 2012 00:15
-
-
Save composite/4281343 to your computer and use it in GitHub Desktop.
Prevent key for input - useful for keypress event; function based
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 preventKey(){ | |
| var shift=[].shift,e=window.event; | |
| if(isNaN(+arguments[0])) e=shift.call(arguments)||e; | |
| for(var i=0,len=arguments.length;i<len;i++){if((e.which||e.keyCode)==arguments[i]) return false;} | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment