Keycodes not working in Mozilla with Javascript
<p>I have code in javascript which get keycodes of different keys and set it to hidden field.
Hidden field is then manipulated by server side code. My code is:</p>

<pre><code>function TriggeredKey(e) {
   e = e || window.event;
   var keycode;
   if (window.event){
     keycode = event.which ? window.event.which : window.event.keyCode;
   }
   alert(keycode);
    document.getElementById("&lt;%=hdfkey.ClientID %&gt;").value = keycode;
   _dopostback();
}
</code></pre>

<p>This code works fine in Chrome but not in Mozilla. Can someone please provide me the solution for this problem?</p>
