WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Navigating with the tab key in Netscape 7


From: Jared Smith
Date: Jan 13, 2003 6:35PM

This appears to be flaw in Netscape 7. onKeyPress should only be
triggered by alphanumeric keys and the enter key. We did a little
testing and found that this is only an issue in Netscape 7. However,
we also found that onClick seems to give the functionality wanted.
Though onClick is a mouse event, it also is triggered by the Enter
key in Netscape 4.8, Netscape 7, and IE. In Opera 7 onClick was
triggered by the Enter key and the space bar. It didn't seem to work
in Opera 6.

onKeyPress also didn't work correctly with Jaws, Home Page Reader, or
Netscape 4.x. Also, onKeyPress is triggered in most browsers by ANY
alphanumeric key, which could be confusing to the user.

In short, it seems that onClick is not restricted to mouse input,
reaches a broader share of browsers, does not have the limitations
of onKeyPress in Netscape 7, and has no apparent accessibility issues.

The best implementation seems to be

<a href="somepage.htm" onClick="javascriptfunction; return false">link label</a>

By adding return false to the onClick event, the link will only go to
the web page (somepage.htm) if the user does not have JavaScript. If
they do have JavaScript, then the href is ignored.

Unless I hear otherwise, it looks like we need to update some of our
documentation to reflect this.

If you'd like to test this and give feedback, I created a very simple
test page at http://www.webaim.org/jared/test.htm

Jared Smith
WebAIM (Web Accessibility In Mind)
Center for Persons with Disabilities
Utah State University

On Monday, January 13, 2003 you sent:
RS> Wondering if anyone else has come across this - in working on an application,
RS> and using onClick and onKeyPress events in links (per the recommendations
RS> of this group), I found that in tabbing through the page, the tab is treated
RS> as an onKeyPress and redirects the user, so that they can never get past
RS> the first link on the page. Has anyone else had to deal with this? Is
RS> there any workaround for it?

RS> Thanks,
RS> Ruth

RS> ----
RS> To subscribe, unsubscribe, or view list archives,
RS> visit http://www.webaim.org/discussion/


To subscribe, unsubscribe, or view list archives,
visit http://www.webaim.org/discussion/