Archive for July, 2006
Here’s something that came up at Jot last week. Which event will be fired continuously, if you hold down a key: onkeydown or onkeypress?
The answer is that it depends on both platform and browser. In general, Windows-based browsers fire only onkeydown, except for Firefox/Win which also fires onkeypress. On the Mac and on Linux, only onkeypress is fired, and onkeydown is not fired on the Firefox browser for these platforms. Something to keep in mind when you bind the “iterate over items while holding arrow up or down key” behaviour to your application. See the testcase.