testcase-multiselectable-D.html (1497B)
1 <!DOCTYPE html> 2 <html><head> 3 <title>ARIA 1.0 Test Case: Listbox role with multiseclect</title> 4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 5 <style> 6 div[aria-selected="true"] {color:white;background-color:black;} 7 </style> 8 </head> 9 <body> 10 <h1>ARIA 1.0 Test Case: Listbox role with multiseclect</h1> 11 12 <div role="listbox" aria-label="charlotte" aria-multiselectable="true"> 13 <div role="option" aria-selected="false" id="ID1" tabindex="-1" onclick="handle1(event)">Option 1 (test for click elected)</div> 14 <div role="option" aria-selected="false" id="ID2" tabindex="-1">Option 2</div> 15 <div role="option" aria-selected="false" id="ID3" onmousedown="handle2(event)">Option 3 (test for shift click selected)</div> 16 </div> 17 18 <script> 19 function handle1(e) { 20 var node=document.getElementById('ID1'); 21 node.focus(); 22 e.stopPropagation(); 23 return false; 24 } 25 function handle2(e) { 26 shiftpressed=0; 27 shiftpressed=e.shiftKey; 28 if (shiftpressed){ 29 var node=document.getElementById('ID1'); 30 node.setAttribute("aria-selected", "true"); 31 node=document.getElementById('ID2'); 32 node.setAttribute("aria-selected", "true"); 33 node=document.getElementById('ID3'); 34 node.setAttribute("aria-selected", "true"); 35 } 36 e.stopPropagation(); 37 return false; 38 } 39 </script> 40 41 </body></html>