dom-hover-002.xht (1080B)
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" 2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 3 <html xmlns="http://www.w3.org/1999/xhtml"> 4 <head> 5 <title>CSS Test: Effect of DOM mutations on :hover matching</title> 6 <link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"/> 7 <link rel="help" 8 href="http://www.w3.org/TR/CSS21/selector.html#dynamic-pseudo-classes" /> 9 <meta name="flags" content="dom interact" /> 10 <script type="text/javascript"> 11 function remove() { 12 var node = document.getElementById("target"); 13 node.parentNode.removeChild(node); 14 } 15 </script> 16 <style> 17 div:hover { color: red; } 18 div#green { color: green; } 19 </style> 20 </head> 21 <body> 22 <div> 23 Dummy text. Dummy text. 24 <div id="target" onmouseover="setTimeout(remove, 1000)"><span>Hover this text, 25 then wait till it disappears. At that point there should be no red.</span> 26 </div> 27 </div> 28 <div id="green"> 29 Dummy text. Dummy text. 30 </div> 31 </body> 32 </html>