683.html (1388B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>ARIA 1.0 Test Case 683</title> 5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 6 </head> 7 <body> 8 <h1>ARIA 1.0 Test Case 683</h1> 9 10 <div id="TEST_ID_1"> 11 </div> 12 13 <h2>Description</h2> 14 <p>An element with an aria-live attribute is added to the document by a script during the onload 15 event with the value="polite". After the onload event completes a child DOM element node is 16 added to the element with the aria-live attribute.</p> 17 18 <script> 19 20 function addChildElementNode() { 21 var node = document.getElementById('TEST_ID_2'); 22 var element_node = document.createElement('div'); 23 var text_node = document.createTextNode("TEST TEXT"); 24 element_node.appendChild(text_node); 25 node.appendChild(element_node); 26 } 27 28 function addLiveRegion() { 29 var node = document.getElementById('TEST_ID_1'); 30 var live_node = document.createElement('div'); 31 live_node.setAttribute('id', 'TEST_ID_2'); 32 live_node.setAttribute('aria-live', 'polite'); 33 node.appendChild(live_node); 34 setTimeout(addChildElementNode,1000); 35 } 36 37 function onload() { 38 addLiveRegion(); 39 } 40 41 window.addEventListener('load', onload); 42 </script> 43 </body> 44 45 </html>