toggle-aria

0.1.0 • Public • Published

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).

Package Sidebar

Install

npm i toggle-aria

Weekly Downloads

0

Version

0.1.0

License

MIT

Last publish

Collaborators

  • marcus-herrmann