www.webdeveloper.com
Results 1 to 2 of 2

Thread: keyCode from keyPress event

  1. #1
    Join Date
    Dec 2007
    Posts
    5

    Post keyCode from keyPress event

    How can i get the keyCode of the key that is pressed from the keyPress event? event.keyCode is returning 0 (Zero) for all alphabet and number keys. This is happening in both Mozilla and Firefox.
    how can i get the keyCode of alphabet and number keys from the keyPress event?
    Note : I cannot use 'charCode' in my code. Hence i need the keyCode itself.

  2. #2
    Join Date
    May 2007
    Posts
    120
    check this
    HTML Code:
    key = (window.event) ? window.event.keyCode : ((e) ? e.which : null);

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles