js COL能很好的控制表格的列 时间:2020-05-12 人气:0 Untitled Document <script language="javascript" type="text/javascript"> var $ = function(pId){ return document.getElementById(pId); } var oCols =document.getElementsByTagName("COL"); var oTab = $("tab1"); oTab.onmouseover = function(evt){ evt = evt || window.event; var o = evt.target || evt.srcElement; if(o.tagName == "TD"){ oCols[o.cellIndex].className = "color1"; o.parentNode.className = "color1"; } } oTab.onmouseout = function(evt){ evt = evt || window.event; var o = evt.target || evt.srcElement; if(o.tagName == "TD"){ oCols[o.cellIndex].className = ""; o.parentNode.className = ""; } } </script> [Ctrl+A 全选 注:如需引入外部Js需刷新才能执行] 加载全部内容