Capslock detection won't work in Javascript
问题 I am trying to detect capslock in Javascript, however the code below always returns false. Firefox and IE web console says that kc and sk are undefined. Event "e" seems to contain a which element, however e.which is undefined. Am I doing something incorrect? I am using devexpress (could this be an issue?) Javascript <script> function isCapslock(e) { kc = e.keyCode ? e.keyCode : e.which; sk = e.shiftKey ? e.shiftKey : ((kc == 16) ? true : false); if (((kc >= 65 && kc <= 90) && !sk) || ((kc >=