714.html (1568B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>ARIA 1.0 Test Case 714</title> 5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 6 </head> 7 <body> 8 <h1>ARIA 1.0 Test Case 714</h1> 9 10 <div id="TEST_ID_1"> 11 </div> 12 13 <h2>Description</h2> 14 <p>The aria-live attribute is added to an element in the document by a 15 script after the onload event completes with the value="assertive" 16 and the element has a child DOM text node with content. After the 17 aria-live attribute is added, the child DOM text node is deleted.</p> 18 19 <script> 20 21 function deleteChildNodes() { 22 var node = document.getElementById('TEST_ID_2'); 23 while (node.firstChild) node.removeChild(node.firstChild); 24 } 25 26 function addLiveRegion() { 27 var node = document.getElementById('TEST_ID_1'); 28 29 var live_node = document.createElement('div'); 30 live_node.setAttribute('aria-live', 'assertive'); 31 live_node.setAttribute('id', 'TESTZ'); 32 33 var element_node = document.createElement('div'); 34 element_node.setAttribute('id', 'TEST_ID_2'); 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,500); 43 } 44 45 function onload() { 46 setTimeout(addLiveRegion,1000); 47 } 48 49 window.addEventListener('load', onload); 50 </script> 51 </body> 52 53 </html>