Hi everyone,
In this post, we are going to learn how to get ASCII KeyCode of User pressed keys using JavaScript and jQuery. Suppose we have an input tag with id “#textbox“. Now try the following codes and have fun.
JavaScript
document.getElementById("textbox").onkeyup = function (e) { alert(e.keyCode); }
jQuery
$("#textbox").keyup(function(e) { alert(e.keyCode); });
If you need any help regarding getting user pressed ASCII keycodes via JavaScript and jQuery, please comment below.
Thank you.
I want to find keyCode value using `keyPress` event in Android mobile.I written a code it’s working fine in desktop and tablets but not working in `Mobile`.For you better understanding check the following link.
http://stackoverflow.com/questions/22473950/keypress-event-not-firing-in-android-mobile/22474166?noredirect=1#22474166
For this, I am trying from morning If you know can you help me.
Thanks.
Hi grandhi,
Its working fine (device: Pantech Burst Stock ICS Default Browser).
For alpha chars, I get false and For numbers, I get true.
Which particular device you’re trying with?