Highlight Table Row on Mouse Over
Posted by Michael on Thursday, Feb 19th, 2009 |
Comments | Javascript, code snippet |
Permalink
Simple Javascript to highlight table rows on mouse over...
<script type="text/javascript">
function hiLiteRows(){
var x = document.getElementsByTagName('tr');
for (var i=0;i<x.length;i++)
{
x[i].onmouseover = function () {this.origColor=this.style.backgroundColor;
this.style.backgroundColor='#D8E5F2';
}
x[i].onmouseout = function () {this.style.backgroundColor=this.origColor;}
}
}
window.onload=hiLiteRows;
</script>