$(document).keypress(function(e) {
if(e.which == 32) {
alert('You pressed spacebar!');
}
});
$(document).keypress(function(e) {
if(e.which == 13) {
alert('You pressed enter!');
}
});
$(document).keypress(function(e) {
if(e.which == 40) {
alert('You pressed down arrow!');
}
});
Here's my javascript file. There is no CSS and the HTML is just a blank skeleton.
It reads the enter and spacebar just fine, but the down arrow, up arrow, or pretty much any key I press that isn't enter or spacebar does not register?
How would one solve this problem?
Any help is appreciated.