WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Implementing aria-hidden via JavaScript


From: Jared Smith
Date: Mar 23, 2014 4:16PM

Karl Groves wrote:
> If for some reason you're dead set to have aria-hidden on there, you can
> simply modify this using jQuery's attr() method.

Or you can add
[aria-hidden=true] {display:none;}
to your CSS and just set the aria-hidden attribute to true/false with jQuery.

I tend to prefer this approach as it allows you to focus on setting
semantic attribute values in your scripting and let CSS handle the
visual presentation/hiding.