W3C home > Mailing lists > Public > w3c-wai-ig@w3.org > October to December 2017

Re: Javascript onClick attribute and accessibility

From: Patrick H. Lauke <redux@splintered.co.uk>
Date: Thu, 19 Oct 2017 17:55:16 +0100
To: w3c-wai-ig@w3.org
Message-ID: <affdcc6a-96a4-399e-b228-749fb474e936@splintered.co.uk>
The use of onclick on a non-focusable element to provide an additional 
way to achieve the same result as following the proper link later on 
seems fine to me. I'd caution that some assistive tech (from memory, not 
tested recently) will helpfully still focus the element if it has an 
onclick handler (as an error-correction mechanism against badly coded 
pages), but hopefully the explicit use of tabindex=-1 should prevent 
that. I'd test it in a variety of browser/AT combos to be absolutely 
sure, but in principle I'd say this is fine in this particular case.

P
-- 
Patrick H. Lauke

www.splintered.co.uk | https://github.com/patrickhlauke
http://flickr.com/photos/redux/ | http://redux.deviantart.com
twitter: @patrick_h_lauke | skype: patrick_h_lauke
Received on Thursday, 19 October 2017 17:16:22 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 6 December 2017 16:04:47 UTC