- From: Alan Chuter <achuter@teleservicios.com>
- Date: Fri, 4 Jul 2003 13:09:11 +0200
- To: "Jon Hanna" <jon@spin.ie>, <w3c-wai-ig@w3.org>
I asumed that the implementation of onclick is interpreted to mean activated in any way, but is it specified anywhere? If it is then I understand that there's no need for redundant event handlers. WCAG techniques say (http://www.w3.org/TR/WCAG10-HTML-TECHS/#directly-accessible-scripts) Use "onclick" with "onkeypress" But this suggests that the technique is no longer necessary, because the browsers have overcome the probleam. Opera doesn't use the tab key for link navigation. It uses A and Q instead. Alan ----- Original Message ----- From: "Jon Hanna" <jon@spin.ie> To: <w3c-wai-ig@w3.org> Sent: Friday, July 04, 2003 12:55 PM Subject: RE: onKeyPress activates link in Opera > > > I have created two links and a JavaScript function. To ensure keyboard > > accessibility, I understand that I should use both onClick and onKeyPress. > > These would normally be used to open a popup window, not an alert box. > > > > <a href="popup.html" onclick="popup('popup.html')">onclick</a> > > <a href="popup.html" onkeypress="popup('popup.html')">onkeypress</a> > > > > function popup(url){ > > window.open(url, ...); > > } > > > > In Opera, the onClick event handler is fired by pressing Enter (which > > doesn't make sense, I think). But the onKeyPress activates the link when I > > navigate off it by pressing the A key. The first behaviour suggests that > > onKeyPress is unnecessary. The second, that using onKeyPress > > actually makes > > the page unusable. Internet Explorer seems to ignore the tab key > > press when > > tabbing through the links. > > > > Am I missing something here? Can I tell people to use onKeyPress as a > > redundant even handler, knowing that it misbehaves in Opera? > > First off I'm guessing that the popup function is going to open a new > window. That probably has more accessibility concerns than the rest of this > issue. > > Secondly onclick doesn't mean "on click" on most browsers > (counter-intuitive, but then it isn't English, it's only English-based). In > order to support keyboard users and other devices apart from mice it means > "on click or otherwise activate this element's default behaviour" - i.e. for > a link it means to either click it or press enter. There isn't any reason to > consider that behaviour as mandated or even compatible with the HTML > standards, but it is the norm, and it's sensible. > > Third, is pressing A a normal way of following a link in Opera? IIRC it's > normally used when reading mails to add the sender to the contacts book. > Therefore why would someone press A (and indeed this will be triggered by > most keys) if they want to follow the link. > >
Received on Friday, 4 July 2003 07:07:07 UTC