I built a game and i am using the arrow keys to move and space bar to shoot and it keeps forcing it down to the bottom of the web page every time i hit the down key or space bar
is there any way to modify the CSS to make it focus on the game div tag and not scroll???
I built a game and i am using the arrow keys to move and
Share
You are failing to cancel the event. If it’s an inline event, just
return false;at the end of it. If it’s done withaddEventListener, callEvent.preventDefault()andreturn false;.