WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: using script emulated links; preferable or not- wcag2


From: Patrick H. Lauke
Date: Jan 21, 2008 1:20AM

Shrirang Sahasrabudhe wrote:

> If i understand it correctly,
> wcag2 prohibits using scripting to emulate links (correct me if wrong)
> <Failures for SC 2.1.1>
> the document lists following test procedure to check the compliance
> F42: Failure of Success Criterion 1.3.1 and 2.1.1 due to using scripting events to emulate links | Techniques for WCAG 2.0
> Test Procedure
> list of 2 items
> 1. Check whether there are JavaScript event handlers on an element that emulates a link.
> 2. Check whether the programmatically determined role of the element is link.

> which one is the better alternative not just from compliance but from usability perspective as well?

The main problem this SC addresses (from my understanding) is things
like attaching an onclick handler on, say, a DIV or a SPAN or something,
as that may work for mouse users, but not keyboard users (as the element
is not in the normal tab cycle, so can't be focussed and activated
normally, and AT doesn't understand that the element acts as a link).
Your better alternative is to actually use an A element (or even better,
if it relies on scripting entirely, *generate* an A element or use Hijax
techniques http://www.google.co.uk/search?q=hijax )

Patrick H. Lauke
re·dux (adj.): brought back; returned. used postpositively
[latin : re-, re- + dux, leader; see duke.]
www.splintered.co.uk | www.photographia.co.uk
Co-lead, Web Standards Project (WaSP) Accessibility Task Force
To manage your subscription, visit http://list.webaim.org/
Address list messages to <EMAIL REMOVED>