dom-hover-001.xht (1025B)
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#green { color: red; } 18 div:hover { color: green !important; } 19 </style> 20 </head> 21 <body> 22 <div id="target" onmouseover="setTimeout(remove, 1000)">Hover this text, 23 then wait till it disappears. At that point there should be no red. 24 </div> 25 <div id="green"> 26 This should end up green. 27 </div> 28 </body> 29 </html>