708.html (1518B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>ARIA 1.0 Test Case 708</title> 5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 6 </head> 7 <body> 8 <h1>ARIA 1.0 Test Case 708</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 15 the onload event with the value="assertive" and the element has a child DOM element 16 node that contains text content. After the onload event completes the child DOM 17 element node is deleted.</p> 18 19 <script> 20 21 22 function deleteChildNodes() { 23 var node = document.getElementById('TEST_ID_2'); 24 while (node.firstChild) node.removeChild(node.firstChild); 25 } 26 27 function addLiveRegion() { 28 var node = document.getElementById('TEST_ID_1'); 29 30 var live_node = document.createElement('div'); 31 live_node.setAttribute('aria-live', 'assertive'); 32 live_node.setAttribute('id', 'TEST_ID_2'); 33 34 var element_node = document.createElement('div'); 35 36 var text_node = document.createTextNode('TEST TEXT'); 37 38 element_node.appendChild(text_node); 39 live_node.appendChild(element_node); 40 node.appendChild(live_node); 41 42 setTimeout(deleteChildNodes,1000); 43 } 44 45 function onload() { 46 addLiveRegion(); 47 } 48 49 window.addEventListener('load', onload); 50 </script> 51 </body> 52 53 </html>