I have a dynamical slider. And trying to add tabindex="-1"
attribute to child when it's parent LI
element has aria-hidden="true"
attribute.
This code is what I am want to be in DOM
<ul class="slider">
<li aria-hidden="true"><a href="#" tabindex="-1">Link</a></li>
<li aria-hidden="true"><a href="#" tabindex="-1">Link</a></li>
<li aria-hidden="false"><a href="#" tabindex="0">Link</a></li>
<li aria-hidden="false"><a href="#" tabindex="0">Link</a></li>
</ul>
Please help
You can try this JQuery code:
$('li[aria-hidden=true]').children().attr('tabindex', '-1');
It selects all li
elements that have an attribute aria-hidden=true
and then sets the attribute tabindex
to '-1' for all children; Edit: Fixed the 'dot' typo.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments