toggle-aria
v0.1.0
Published
Small utility plugin for toggling ARIA states
Downloads
1
Maintainers
Readme
toggleAria
Little jQuery-Plugin for toggling WAI-ARIA states like aria-busy
, aria-disabled
, aria-expanded
, and aria-hidden
.
Imagine it as the counterpart to jQuery's toggleClass
.
Just pass the state name as a parameter. Usage example for aria-expanded
on a mobile menu trigger (why on the trigger? See here):
$("#nav__toggle").click(function(){
$(this).toggleAria("expanded");
$("#nav").toggleClass("nav--open");
});
See demo on CodePen (and use your browser's inspector on the button).