Difference between revisions of "ARIA Expanded state"

From Level Access Web Labs
Jump to navigation Jump to search
Line 7: Line 7:
 
   <head>
 
   <head>
 
     <script type="text/javascript">
 
     <script type="text/javascript">
       function toggle() {
+
       function toggle(obj) {
         if (this.getAttribute('aria-expanded') == 'true') {
+
         if (obj.getAttribute('aria-expanded') == 'true') {
           this.setAttribute('aria-expanded','false');
+
           obj.setAttribute('aria-expanded','false');
           this.nextSibling.className = "hidden";
+
           obj.nextSibling.className = "hidden";
 
         }
 
         }
 
         else {
 
         else {
           this.setAttribute('aria-expanded','true');
+
           obj.setAttribute('aria-expanded','true');
           this.nextSibling.className = "";         
+
           obj.nextSibling.className = "";         
 
         }
 
         }
 
       }
 
       }

Revision as of 15:01, 11 September 2014

Activate the buttons to expand them and set the aria-expanded state to true. Activate again to collapse.