WebAIM - Web Accessibility In Mind

E-mail List Archives

Jquery.focus() and screen reader

for

From: Date: Aug 16, 2017 5:45AM


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