accessible-rich-internet-applications/pa/aria-accordion-demo.js
/**
 * toggle function to show or hide the content
 */
toggle function to show or hide the content
toggle function to show or hide the content
function toggleContent(tab, tabPanel) {
  if (tab.getAttribute('aria-selected') == "true") {
  	tab.setAttribute('aria-selected', false);
  	tabPanel.setAttribute('aria-expanded', false);
  	tabPanel.setAttribute('aria-hidden', true);
  } else {
  	tab.setAttribute('aria-selected', true);
  	tabPanel.setAttribute('aria-expanded', true);
  	tabPanel.setAttribute('aria-hidden', false);
  }
}
function toggleContent ( tab , tabPanel ) { if ( tab . getAttribute ( 'aria-selected' ) == "true" ) { tab . setAttribute ( 'aria-selected' , false ) ; tabPanel . setAttribute ( 'aria-expanded' , false ) ; tabPanel . setAttribute ( 'aria-hidden' , true ) ; } else { tab . setAttribute ( 'aria-selected' , true ) ; tabPanel . setAttribute ( 'aria-expanded' , true ) ; tabPanel . setAttribute ( 'aria-hidden' , false ) ; } }
toggle function to show or hide the content
toggle function to show or hide the content
/* useful debug log
	 console.log("in toggleContent, what is tab, tab is "+tab);
	 console.log("in toggleContent, what is tabpanel, tabPanel is "+tabPanel);
	 console.log("tabPanel.getAttribute(aria-hidden) is "+tabPanel.getAttribute('aria-hidden'));
*/ /**
   * if saria-elected is selected or true 
   * then un-select aria-selected or set it to flase and then
   * reset expanded to false and hidden to true
   */ /**
  	 * else reset the attribute oppostie of the above
  	 */