<div class="htmlarea"> <textarea id="runcode14291"><script> function overIt(){ var the_obj = event.srcElement; if(the_obj.tagName.toLowerCase() == "td"){ the_obj=the_obj.parentElement; the_obj.oBgc=the_obj.currentStyle.backgroundColor; the_obj.oFc=the_obj.currentStyle.color; the_obj.style.backgroundColor='red'; the_obj.style.color='blue'; the_obj.style.textDecoration='underline'; } } function outIt(){ var the_obj = event.srcElement; if(the_obj.tagName.toLowerCase() == "td"){ the_obj=the_obj.parentElement; the_obj.style.backgroundColor=the_obj.oBgc; the_obj.style.color=the_obj.oFc; the_obj.style.textDecoration=''; } } </script> <table border="1" width="400" onmouseover="overIt()" onmouseout="outIt()"> <tr bgcolor="#111111"> <td>aaa</td> <td>aaa</td> <td>aaa</td> <td>aaa</td> </tr> <tr bgcolor="#222222"> <td>aaa</td> <td>aaa</td> <td>aaa</td> <td>aaa</td> </tr> <tr bgcolor="#333333"> <td>aaa</td> <td>aaa</td> <td>aaa</td> <td>aaa</td> </tr> <tr bgcolor="#444444"> <td>aaa</td> <td>aaa</td> <td>aaa</td> <td>aaa</td> </tr> <tr bgcolor="#555555"> <td>aaa</td> <td>aaa</td> <td>aaa</td> <td>aaa</td> </tr> <tr bgcolor="#666666"> <td>aaa</td> <td>aaa</td> <td>aaa</td> <td>aaa</td> </tr> <tr bgcolor="#777777"> <td>aaa</td> <td>aaa</td> <td>aaa</td> <td>aaa</td> </tr> <tr bgcolor="#888888"> <td>aaa</td> <td>aaa</td> <td>aaa</td> <td>aaa</td> </tr> <tr bgcolor="#999999"> <td>aaa</td> <td>aaa</td> <td>aaa</td> <td>aaa</td> </tr> <tr bgcolor="#aaaaaa"> <td>aaa</td> <td>aaa</td> <td>aaa</td> <td>aaa</td> </tr> <tr bgcolor="#bbbbbb"> <td>aaa</td> <td>aaa</td> <td>aaa</td> <td>aaa</td> </tr> <tr bgcolor="#cccccc"> <td>aaa</td> <td>aaa</td> <td>aaa</td> <td>aaa</td> </tr> <tr bgcolor="#dddddd"> <td>aaa</td> <td>aaa</td> <td>aaa</td> <td>aaa</td> </tr> <tr bgcolor="#eeeeee"> <td>aaa</td> <td>aaa</td> <td>aaa</td> <td>aaa</td> </tr> <tr bgcolor="#ffffff"> <td>aaa</td> <td>aaa</td> <td>aaa</td> <td>aaa</td> </tr> </table></textarea><br><input onclick="runEx('runcode14291')" type="button" value="运行代码"> <input onclick="doCopy('runcode14291')" type="button" value="复制代码"> <input onclick="doSave(runcode14291)" type="button" value="保存代码">[Ctrl+A 全选 注:<a href="http://www.jb51.net/article/23421.htm" title="查看具体详情" target="_blank">如需引入外部Js需刷新才能执行</a>]</div>