Difference between revisions of "ARIA Expanded state"

From Level Access Web Labs
Jump to navigation Jump to search
Line 14: Line 14:
 
         }
 
         }
 
         else {
 
         else {
       alert(obj.id);
+
       alert(obj.nextSibling.id);
 
           obj.setAttribute('aria-expanded','true');
 
           obj.setAttribute('aria-expanded','true');
 
           obj.nextSibling.className = "";         
 
           obj.nextSibling.className = "";         
Line 25: Line 25:
 
   <section>
 
   <section>
 
     <button onclick="toggle(this);" id="b1" aria-expanded="false"> Details </button>
 
     <button onclick="toggle(this);" id="b1" aria-expanded="false"> Details </button>
     <p class="hidden"> This is some text.</p>
+
     <p class="hidden" id="p1"> This is some text.</p>
 
   </section>
 
   </section>
 
   <section>
 
   <section>
 
     <a onclick="toggle(this);" id="a1" aria-expanded="false" > SSB</a>
 
     <a onclick="toggle(this);" id="a1" aria-expanded="false" > SSB</a>
     <p class="hidden">SSB BART Group is an digital accessibility solutions provider.</p>
+
     <p class="hidden" id="p2">SSB BART Group is an digital accessibility solutions provider.</p>
 
   </section>
 
   </section>
 
   <body>
 
   <body>
 
</html>
 
</html>
 
[[Category: ARIA]]
 
[[Category: ARIA]]

Revision as of 15:17, 11 September 2014

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