/* Generate the Tab Bar UL Object */ var tabListHTML = document.createElement('ul'); tabListHTML.id = 'gtTabList_' + set; tabListHTML.className = 'gtTabList'; tabListHTML.setAttribute('role', 'tablist'); for (var section = 0; section < tabList.length; section++) { var tabHTMLA = document.createElement('a'); tabHTMLA.id = 'gtTabTitle_' + set + '_' + section; tabHTMLA.innerHTML = tabList[section]; tabHTMLA.href = "javascript:gtJSUI_selectTab('" + set + "','" + section + "');"; tabHTMLA.setAttribute('role', 'tab'); tabHTMLA.setAttribute('aria-controls', 'gtTab_' + set + '_' + section); tabHTMLA.setAttribute('aria-selected', (section == 0 ? 'true' : 'false')); var tabHTML = document.createElement('li'); tabHTML.setAttribute('role', 'presentation'); if (section == 0) { tabHTML.className = 'gtTabSelected'; } tabHTML.appendChild(tabHTMLA); tabListHTML.appendChild(tabHTML); } tabSetList[set].insertBefore(tabListHTML, tabSetList[set].childNodes[0]);
Making JavaScript Powered UI Accessible