I’m seeing a wierd issue in javascript, or maybe it’s because javascript is new to me.
I am trying to allow some action if onkeypress, but only when alphanumeric or special character is pressed. This is my code:
if(e.keyCode>=32 && e.keyCode<=126 ){
alert(e.keyCode);}
}
It does not alert if I press any special character key like {,]>. am I missing anything here?
The
keyCodefor a comma (,) is 188. Could this be why?http://www.cambiaresearch.com/articles/15/javascript-char-codes-key-codes