2 * File skip-link-focus-fix.js.
4 * Helps with accessibility for keyboard only users.
6 * Learn more: https://git.io/vWdr2
9 var isIe = /(trident|msie)/i.test( navigator.userAgent );
11 if ( isIe && document.getElementById && window.addEventListener ) {
12 window.addEventListener( 'hashchange', function() {
13 var id = location.hash.substring( 1 ),
16 if ( ! ( /^[A-z0-9_-]+$/.test( id ) ) ) {
20 element = document.getElementById( id );
23 if ( ! ( /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) ) {
24 element.tabIndex = -1;