[whatwg] focus change inside keypress event handler

Thomas Broyer t.broyer at gmail.com
Wed Oct 28 02:01:46 PDT 2009

On Wed, Oct 28, 2009 at 2:43 AM, Michael A. Puls II
<shadow2531 at gmail.com> wrote:
> (CCing DOM list just in case anyone there has any comments)
> With:
> <p><input onkeypress="this.nextSibling.focus()"><input></p>
> , if you type a character in the first field, should the character be
> entered in the second field or the first?
> In Firefox and Safari, it's the first field. In IE and Opera, it's the
> second.
> I do think FF and Safari's way makes more sense and I think most will agree.

If we consider keypress to be the same as DOM-3 Events' textinput,
then it makes way more sense for the char to be added to the first
field (i.e. the Gecko/WebKit way).

My .2c

Thomas Broyer

More information about the whatwg mailing list