W3C home > Mailing lists > Public > wai-wcag-editor@w3.org > October to December 2002

Re: JavaScript onClick event

From: Phill Jenkins <pjenkins@us.ibm.com>
Date: Thu, 31 Oct 2002 01:47:03 -0500
To: sec508@trace.wisc.edu
Cc: wai-wcag-editor@w3.org
Message-ID: <OF61077A8C.2817EB9E-ON86256C63.0022965D@pok.ibm.com>

The Webmaster is misinformed and Jim is correct.

I recommend NOT to use the second redundant onkeypress event.  The browser
causes the onclick event to be fired when the user presses the Enter key.
If the author also adds the onkeypress event, then the browser sends two
events to the server, causing all kinds of havoc on the server.  It's the
browser's responsibility to map the mouse and keyboard events where
possible, not the author's.

And, you don't have to take my word for it, code it and test it for

The onclick guidance given in the W3C techniques document [1] is wrong, and
I've submitted a comment to the editors, while the onclick guidance on the
Access Board [2] is more current and correct.  [There are however other
problems with the other guidance.]  Which events are currently mapped and
which events should be equivalent is not well documented anywhere and needs
to be so that browsers and authors can get in sync on what to do.  Pressure
was put on browser manufactures to provide a keyboard way to navigate (tab
to links and controls), select, and activate controls, etc.  Unfortunately
at the same time the theory was perpetuated that the author had to make the
code more device independent by adding redundant events when in fact it
caused confusion.  The W3C browser accessibility standard [3] also requires
the browser to provide a keyboard way to activate all functions (which is

[1] W3C WCAG Techniques

[2] Access Board guidance

[3] W3C User Agent Accessibility Guidelines

Phill Jenkins
IBM Research Division - Accessibility Center
Received on Thursday, 31 October 2002 01:47:40 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:17:05 UTC