Posted By

jlvallelonga on 03/24/09


Tagged

get event character code key press ok onkeypress


Versions (?)

getKeyCode


 / Published in: JavaScript
 

send in the event to get the key code useful with onKeyPress javascript event

  1. function getKeyCode(e) {
  2. code = -1;
  3. if (window.event)
  4. code = e.keyCode;
  5. else if (e.which)
  6. code = e.which;
  7. return code;
  8. }

Report this snippet  

You need to login to post a comment.