I\'m trying to let a user move an element on the page using the arrow keys. So far, I have movement working for up/down/left/right, but not for diagonal (two arrow keys pres
Here is your code for you, slightly revised ... http://jsfiddle.net/w8uNz/ It just WORKS. Moves element across the parent element.
Rob W is right, you should have a dynamic cache of keys being pressed down at a period of time. But for what ? if you are making a dynamic game - there must be much higher abstraction for that. And overall, you need to improve your level of coding if you want to do stuff like that. (Or it will just generate headaches for you.)