/*----------------------------------------------------------------------------------------------// // // // Function to add non-visible information to a link // // // //----------------------------------------------------------------------------------------------*/ function elaborateLink(lnk,inf) { //This function searches the page for a link containing the lnk parameter // var x = document.body; // var x = getDisplayDocument().getElementById("pageDIV"); var y = x.getElementsByTagName("span"); //loop through the tags to find the lnk string for (i = 0; i < y.length; i++) { var elem = y[i]; var elem_txt = elem.textContent; //test the text content of a tag for a match if ( elem_txt.indexOf(lnk) != -1 ) { //a match was found, so add the aria-label attribute to the parent node var elepr = elem.parentNode; elepr.setAttribute("aria-label",lnk + " - " + inf); }//end_if }//end_for_loop }//end_function_elaborateLink