WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Jquery.focus() and screen reader

for

From: JP Jamous
Date: Aug 16, 2017 7:13AM


If it is opening in a new window, the SR will start reading the DOM from top to bottom. Why do you need to set the focus on the text?

My concern is that you might run into issues with JAWS, as it would want to read the DOM from the top as soon as it loads in the browser. Are you testing with multiple screen readers? If not, you should because what might work for NVDA might not work for JAWS and VoiceOver.

-----Original Message-----
From: WebAIM-Forum [mailto: <EMAIL REMOVED> ] On Behalf Of Ócsvári Áron
Sent: Wednesday, August 16, 2017 6:45 AM
To: WebAIM Discussion List < <EMAIL REMOVED> >
Subject: [WebAIM] Jquery.focus() and screen reader

Hello,

I have a jQuery script. When I click a link, a non-modal windows pops up, and show a text.

I added alert role for the div, so my screen reader (NVDA) announces it properly. My problem is that the focus of NVDA does not move to this text.

What would be the sollution for this? My code are the following:

jQuery('.licence-agreement').attr('role', 'alert'); jQuery('.licence-agreement').show().css("position","absolute");

jQuery('.licence-agreement').focus();

The html:

<div class='licence-agreement'style='display:none;'>
<p>Hello!</p>

...

</div>

Thanks for your help!

Regards,

Aron

---
This email has been checked for viruses by AVG.
http://www.avg.com