You need to click the game so that your input will be in game. If you click outside the game, you'll give input on the page's browser, that's why it scroll down to the bottom of the screen. Hope it helps :)