55
rated 0 times
[
62]
[
7]
/ answers: 1 / hits: 22435
/ 11 Years ago, mon, july 1, 2013, 12:00:00
In the following code:
$(document).keypress(function(e) {
var code = (e.keyCode ? e.keyCode : e.which);
if (code == 40) {
alert(down pressed);
} else if (code == 38) {
alert(up pressed);
}
});
I'm trying to detect if the down key or up key is pressed. Why isn't it working?
Fiddle
http://jsfiddle.net/K9uDn/10/
I'm in chrome
More From » jquery