By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,459 Members | 1,208 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,459 IT Pros & Developers. It's quick & easy.

Key code Event in firefox

P: 7
Hi i got the keycode for ie like (event.keyCode) but this is not working in the firefox browser. can u give me the solution for the both the browsers.
May 30 '09 #1
Share this Question
Share on Google+
2 Replies

P: 638
here watch this post my be of a help to you
Omer Aslam
May 30 '09 #2

Expert Mod 15k+
P: 16,027
Expand|Select|Wrap|Line Numbers
  1. function doSomething(e) {
  2.     var code;
  3.     var e = e || window.event;
  4.     if (e.keyCode) code = e.keyCode;
  5.     else if (e.which) code = e.which;
  6.     var character = String.fromCharCode(code);
  7.     alert('Character was ' + character);
  8. }
May 30 '09 #3

Post your reply

Sign in to post your reply or Sign up for a free account.