# wp-optimize/4.7.0/js/sortable/sortable.a11y.min.js

WP-Optimize – Cache, Compress images, Minify &amp; Clean database to boost page speed &amp; performance, version 4.7.0. 3 lines.

- Page: https://pluginprobe.com/plugins/wp-optimize/4.7.0/code/js/sortable/sortable.a11y.min.js
- Raw: https://pluginprobe.com/plugins/wp-optimize/4.7.0/raw/js/sortable/sortable.a11y.min.js
- Modified: 2025-02-10T11:14:44+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/wp-optimize/4.7.0/code/js/sortable/sortable.a11y.min.js#L10-L20`.

```javascript
var enhanceSortableAccessibility=function(g){function h(c){"Enter"===c.key&&c.target.click()}g.forEach(function(c){var k=c.classList.contains("asc")?"ascending":"";c.querySelectorAll("th").forEach(function(a){if(!a.hasAttribute("tabindex")){var e=function(){var d=k,b;void 0===d&&(d="");var l=a.textContent||"element",f=null!==(b=a.getAttribute("aria-sort"))&&void 0!==b?b:"";b="descending";if("descending"===f||d&&"ascending"!==f)b="ascending";d="Click to sort table by ".concat(l," in ").concat(b," order");
a.setAttribute("aria-label",d)};a.setAttribute("tabindex","0");e();a.addEventListener("click",function(){setTimeout(e,50)});a.addEventListener("focus",e);a.addEventListener("keydown",h)}})})};document.addEventListener("DOMContentLoaded",function(){enhanceSortableAccessibility(document.querySelectorAll(".sortable"))});

```
