i need a simple bind on a keypress (right arrow) but i just cant make it work
i dont know on what should i chain the .keypress() method and the variable just wont take the key code in. it reacts on key press (it logs it on the console) but just not what i want. i am not alowed to use any plugins or jquery UI.
$("*").keypress(function(e){
console.log(e); //this returns [object object]
if (e.which == 39 || e.keyCode == 39 || window.event.keyCode == 39){
$('.someDiv').click();
};
});
any ideas?
You can use the
documentobject, also note that jQuery normalizes thewhichproperty and it is cross-browser: